Commit Graph

15438 Commits

Author SHA1 Message Date
Michael Kerrisk 9764a9ff2a eventfd.2: Note that eventfd info is available in /proc/PID/fdinfo
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-08 19:24:48 +01:00
Michael Kerrisk 13dd2598aa signalfd.2: Note that signalfd info is available in /proc/PID/fdinfo
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-08 19:24:47 +01:00
Michael Kerrisk aaf7a57425 open.2: NOTES: mention existence of proc/PID/fd and /proc/PID/fdinfo
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-08 18:58:34 +01:00
Michael Kerrisk b6a7fd5032 proc.5: Add some kernel version numbers for /proc/PID/fdinfo entries
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-08 18:50:06 +01:00
Marko Myllynen e27900b2e8 locale.5: tel + fax are deprecated
Reviewed-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-08 18:16:28 +01:00
Michael Kerrisk 8bbae7d03c adjtimex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 19:30:53 +01:00
Michael Kerrisk ebfc893ec7 adjtimex.2: Add ATTRIBUTES section
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 11:15:18 +01:00
Michael Kerrisk 85c30f7eab ntp_gettime.3: Add ATTRIBUTES section
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 11:15:18 +01:00
Michael Kerrisk 39ad98a088 sysconf.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 11:15:18 +01:00
Michael Kerrisk b5133e9ad9 ntp_gettime.3: Note that these APIs always succeed
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 11:15:18 +01:00
Michael Kerrisk 55b82822e8 adjtimex.2: srcfix: update copyright
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 11:15:10 +01:00
Michael Kerrisk c40843ae0b adjtimex.2: Minor wording tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 02:21:28 +01:00
Michael Kerrisk cfb9b2f966 ntp_gettimex.3: New link to ntp_gettime.3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 01:36:29 +01:00
Michael Kerrisk 97816cb94a time.7: SEE ALSO: add ntp_adjtime(3) and ntp_gettime(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 01:35:13 +01:00
Michael Kerrisk cf19a3b98c adjtimex.2: SEE ALSO: add ntp_gettime(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 01:35:13 +01:00
Michael Kerrisk 4ed5a32d22 adjtimex.2: Minor wording and formatting fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 01:35:12 +01:00
Michael Kerrisk e837b41c13 adjtimex.2: Improve description of some PPS timex fields
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 01:35:12 +01:00
Michael Kerrisk 6d78bc966a ntp_gettime.3: New page describing ntp_gettime(3) and ntp_gettimex(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 01:34:55 +01:00
Michael Kerrisk b346e7a030 adjtimex.2: Document ntp_adjtime(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-07 01:10:23 +01:00
Michael Kerrisk 90d4198f2a adjtimex.2: Don't refer reader to adjtime(3)
Probably, it's not wise to suggest adjtime(3) as the more
portable API. Rather, ntp_adjtime(3) should be used.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-06 22:51:42 +01:00
Michael Kerrisk 46c7501043 adjtimex.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-06 11:06:11 +01:00
Michael Kerrisk de69c712ba adjtimex.2: Minor tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-06 06:21:53 +01:00
Michael Kerrisk 82b43a7692 posix_spawn.3: Tweak a few more details
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 10:26:32 +01:00
Michael Kerrisk 5356204785 posix_spawn.3: Add note on "posix_fspawn" functionality
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 10:26:32 +01:00
Michael Kerrisk 7b5e3ad522 posix_spawn.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 10:26:32 +01:00
Michael Kerrisk c0d82fb9cb posix_spawnp.3: New link to new posix_spawn.3 page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 10:26:32 +01:00
Michael Kerrisk 10069ed030 posix_spawn.3: Major reworking of and additions to contributed page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 10:26:32 +01:00
Bill O. Gallmeister a5458d4938 posix_spawn.3: New man page for posix_spawn(3) and posix_spawnp(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 10:26:32 +01:00
Michael Kerrisk 53ee58a32c socketpair.2: Note treatment of 'sv' on error
Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 08:52:29 +01:00
Michael Kerrisk 89cfe0cf65 pipe.2: Note treatment of 'pipefd' on error
Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 08:52:29 +01:00
Michael Kerrisk df383cdf95 posix_memalign.3: Note posix_memalign()'s treatment of 'memptr' on error
Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 08:52:29 +01:00
Michael Kerrisk 367122710b standards.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 08:52:29 +01:00
Michael Kerrisk c9d27ddbf9 standards.7: Add POSIX.1-2008 TC2 (POSIC.1-2016)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-05 08:52:29 +01:00
Michael Kerrisk 9414812651 adjtimex.2: Minor fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 17:25:09 +01:00
Michael Kerrisk 178635c4e4 adjtimex.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 17:25:09 +01:00
Michael Kerrisk 1a96e4f2ba adjtimex.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 17:25:09 +01:00
Michael Kerrisk 2f01620267 adjtimex.2: Various improvements after feedback from John Stultz
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 17:25:09 +01:00
Michael Kerrisk f4d9c97d6a adjtimex.2: Note range constraints and clamping for ADJ_FREQUENCY
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 17:25:04 +01:00
Michael Kerrisk 88ec900f22 adjtimex.2: Note treatment of out-of-range buf.offset
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 14:32:46 +01:00
Michael Kerrisk a2300b58d1 adjtimex.2: Update details of buf.offset EINVAL error
Reported-by: Naresh Kamboju <naresh.kernel@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 14:32:30 +01:00
Michael Kerrisk 77a47e474d adjtimex.2: Split EINVAL error cases
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 14:07:12 +01:00
William Preston f3910b4712 adjtimex.2: Update a detail in adjtimex return value description
Starting with Linux 3.4, the time_state change is now asynchronous
and the call returns the time_state before it has been altered,
rather than after it was altered as the previous code did.

======================================================

Notes from Petr Gajdos

attached program behaves differently on 2.6 and 3.0 kernels:

*******************************************************
2.6.32.59-0.7-default

Insert LS
adjtimex() return code 1: insert leap second (TIME_INS)
Kernel leap second flag: STA_INS

Delete LS
adjtimex() return code 2: delete leap second (TIME_DEL)
Kernel leap second flag: STA_DEL

Insert LS again
adjtimex() return code 1: insert leap second (TIME_INS)
Kernel leap second flag: STA_INS

Delete LS again
adjtimex() return code 2: delete leap second (TIME_DEL)
Kernel leap second flag: STA_DEL

*******************************************************
3.0.101-0.35-default

sbsvt101:~/tmp # ./adjt
Insert LS
adjtimex() return code 0: clock synchronized (TIME_OK)
Kernel leap second flag: STA_INS

Delete LS
adjtimex() return code 1: insert leap second (TIME_INS)
Kernel leap second flag: STA_DEL

Insert LS again
adjtimex() return code 2: delete leap second (TIME_DEL)
Kernel leap second flag: STA_INS

Delete LS again
adjtimex() return code 1: insert leap second (TIME_INS)
Kernel leap second flag: STA_DEL

*******************************************************

The explanation provided by William Preston (in CC):

"""
in both cases you get the actual value of the global kernel variable
time_state.

The code changed between the two kernels in the way it handled this.

In 2.6.32.59 the adjtimex call starts a timer immediately with the
function ntp_start_leap_timer(), which sets the value of time_state
before returning to the user.

This means you will get the value TIME_INS / TIME_DEL back
immediately.

In 3.0.101, the timer has been removed and the value of time_state is
set when the microsecond field overflows. The function
second_overflow() handles this. This means the value of time_state
will not have been set when the syscall adjtimex returns, and so you
will almost certainly get the old state.

Incidentally if you remove the sleep() calls in the code for 3.0.101
you may instead see the state of TIME_OK when switching between
STA_INS / STA_DEL.

All this is completely normal and expected behaviour, since both
return the current state, however I agree it is not intuitive.

I would recommend calling adjtimex without a mode to get the actual
state of the system after waiting a second.

At the same time, William suggests the patch in the attachement.

Petr

=============== adjt.c ================

void adjtm(int);

int main()
{
    printf("Insert LS\n");
    adjtm(STA_INS);

    sleep(2);
    printf("\nDelete LS\n");
    adjtm(STA_DEL);

    sleep(2);
    printf("\nInsert LS again\n");
    adjtm(STA_INS);

    sleep(2);
    printf("\nDelete LS again\n");
    adjtm(STA_DEL);

    printf("\nRestoring initial state\n");
    adjtm(0);
}

/*************************************/
/*  Modify LS flag and print status  */
/*************************************/
void adjtm(int ls)
{
    struct timex tx;
    int rc;

    tx.modes = ADJ_STATUS;
    tx.status = ls;

    if ((rc = adjtimex(&tx)) == -1) {
	perror("adjtimex()");
	exit(1);
    }

    sleep(2);

    tx.modes = 0;
    rc = adjtimex(&tx);

    printf("adjtimex() return code %d: ", rc);
    switch (rc) {
    case TIME_OK:
	printf("clock synchronized (TIME_OK)\n");
	break;

    case TIME_INS:
	printf("insert leap second (TIME_INS)\n");
	break;

    case TIME_DEL:
	printf("delete leap second (TIME_DEL)\n");
	break;

    case TIME_OOP:
	printf("leap second in progress (TIME_OOP)\n");
	break;

    case TIME_WAIT:
	printf("leap second has occurred (TIME_WAIT)\n");
	break;

    case TIME_BAD:
	printf("clock not synchronized (TIME_BAD)\n");
	break;

    default:
	printf("Unknown return code: %i\n", rc);
	break;

    }

    printf("Kernel leap second flag: ");
    if (tx.status & STA_INS)
	printf("STA_INS\n");
    else if (tx.status & STA_DEL)
	printf("STA_DEL\n");
    else
	printf("not set\n");
}
=======================================

Reported-by: Petr Gajdos <pgajdos@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 12:22:46 +01:00
Michael Kerrisk e3548e1d64 adjtimex.2: Add some FIXMEs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-04 12:22:46 +01:00
Michael Kerrisk 9b4a382a79 svipc.7: Tweak description of 'sempid'
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-03 08:55:49 +01:00
Michael Kerrisk cd65c2b1eb semop.2: Tweak comment describing 'sempid'
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-03 08:53:23 +01:00
Michael Kerrisk 9c048ec195 fmemopen.3: Note one more memory stream bug that was fixed in glibc 2.22
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-02 16:23:19 +01:00
Michael Kerrisk 39ef79baad fmemopen.3: Note various fmemopen() bugs that were fixed in glibc 2.22
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-02 16:23:19 +01:00
Michael Kerrisk f435db47cd opendir.3: Help the reader by explicitly mentioning the use of readdir(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-02 12:32:04 +01:00
Michael Kerrisk 0fdfbd140d readdir.3: Minor tweaks to 'd_name' text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-02 12:30:32 +01:00
Michael Kerrisk 307b34a803 readdir.3: Add a lot more detail on portable use of the 'd_name' field
Include also some information from comments by Florian Weimer,
Paul Eggert, and Rich Felker.

Reported-by: Florian Weimer <fweimer@redhat.com>
Reported-by: Rich Felker <dalias@aerifal.cx>
Reported-by: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-02 12:30:32 +01:00