Commit Graph

18327 Commits

Author SHA1 Message Date
Michael Kerrisk 46841acec3 sysfs.5: New page documenting the sysfs filesystem
Just a skeleton page so far, but perhaps it will be filled out
over time.

Reported-by: Mark Wielaard <mark@klomp.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-11 07:43:17 +02:00
Michael Kerrisk 268bac1ffa sincos.3: Note that sincos() is intended to be more efficient than sin() + cos()
On a current x86-64 i7 system, sincos() is about 15% faster than
sin()+cos() according to the following test program.

/*
 * Build with: cc -O -lm -fno-fast-math -fno-builtin
 */

int
main(int argc, char *argv[])
{
    double arg, rsin, rcos;
    int loop, i;

    arg = strtod(argv[1], NULL);
    loop = 10000000;
    if (argc > 2)
        loop = atoi(argv[2]);

    if (argc > 3) {
        printf("sin + cos\n");
        for (i = 0; i < loop; i++) {
            rsin = sin(arg);
            rcos = cos(arg);
        }
    } else {
        printf("sincos\n");
        for (i = 0; i < loop; i++) {
            sincos(arg, &rsin, &rcos);
        }
    }
}

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-11 07:42:42 +02:00
Michael Kerrisk 31fa1fd2a6 proc.5: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-10 12:50:36 +02:00
Michael Kerrisk 6354e66208 pow10.3: Note that pow10() is now obsolete in favor of exp10()
Also, the pow10() functions are no longer supported by glibc,
starting with version 2.27.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-10 12:50:11 +02:00
Michael Kerrisk b9f5883bd5 pow10.3: Minor rewording
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-10 08:49:54 +02:00
Michael Kerrisk 64165e0118 proc.5: Explicitly note in intro that some /proc files are writable 2017-09-10 08:49:54 +02:00
Michael Kerrisk b574c52d85 proc.5: Show command used to mount /proc
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-10 08:49:54 +02:00
Michael Kerrisk 7e17465102 proc.5: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-10 08:02:52 +02:00
Michael Kerrisk 7048a9fc8e getrandom.2: SYNOPSIS: make return type of getrandom() 'ssize_t'
This accords with glibc headers and the Linux kernel source.

Reported-by: Fabio Scotoni <fabio@esse.ch>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-10 07:42:53 +02:00
Michael Kerrisk 2021d0b3be fsync.2: Minor text reworking
Move the discussion of fsync() and metadata into a separate
paragraph to make the point more obvious.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-10 07:31:35 +02:00
Tej Chajed 296951cfd5 fsync.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-10 07:28:31 +02:00
Michael Kerrisk e931e0355f mprotect.2: Add warning about the use of printf() in the example code
Reported-by: Shrikant Giridhar <shrikantgiridhar@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-09 07:45:57 +02:00
Michael Kerrisk bf27fd0a15 timer_create.2: Strengthen the warning about use of printf() in the example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-09 07:43:14 +02:00
Michael Kerrisk 994e9b46f5 timer_create.2: Update cross reference: signal(7) should be signal-safety(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-09 07:37:20 +02:00
Michael Kerrisk 6edadda685 request_key.2, statx.2, pthreads.7: Fix order of SEE ALSO entries
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 21:10:48 +02:00
Michael Kerrisk d64b372593 add_key.2, backtrace.3, syslog.3: Fix misordered SEE ALSO entries
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 21:06:48 +02:00
Michael Kerrisk 3b3b8d5dcc getdents.2, ioctl_fat.2, mkdir.2, process_vm_readv.2, get_phys_pages.3, nextup.3, operator.7: srcfix: fix unbalanced .nf/.fi pairs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 20:43:22 +02:00
Michael Kerrisk d773899bf7 access.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 20:40:03 +02:00
Michael Kerrisk 6ae1ccd13d pldd.1: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 20:39:32 +02:00
Michael Kerrisk 466d92ed3c cpuset.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 20:38:50 +02:00
Michael Kerrisk a3847715fe clock_getres.2, ctime.3, tgamma.3: srcfix: fix unbalanced .RS/.RE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 20:38:25 +02:00
Michael Kerrisk 61d92a911a sock_diag.7: Fix misordering of sections
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 18:12:23 +02:00
Michael Kerrisk f2910c72c2 random.4: Fix misordering of sections
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 18:09:19 +02:00
Michael Kerrisk 34a2ee189b ftw.3: Fix misordering of sections
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 18:08:09 +02:00
Michael Kerrisk a2d7a55eca cfree.3: Fix misordering of sections
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 18:07:04 +02:00
Michael Kerrisk e5efbe9106 ioctl_userfaultfd.2: Fix misordering of sections
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 18:05:06 +02:00
Michael Kerrisk e89b82b758 ioctl_ns.2: Fix misordering of sections
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 18:04:14 +02:00
Michael Kerrisk 1172adfab5 ioctl_iflags.2: Fix misordering of sections
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 18:03:13 +02:00
Li Zhijian 21f685fd8f request_key.2: wfix: /etc/request-keys.conf -> /etc/request-key.conf
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-06 09:36:44 +02:00
Michael Kerrisk 59d99553ae crypt.3: Note glibc version that added 'rounds' parameter
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-05 20:15:43 +02:00
Michael Kerrisk 42079b0179 crypt.3: Rework text describing 'rounds' parameter
The text reads a little more clearly if we talk about
'xxx' rather than 'the supplied number'.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-05 20:13:18 +02:00
Michael Kerrisk 4c130fabc3 crypt.3: Minor wording improvements to Konstantin's patches
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-05 20:13:18 +02:00
Konstantin Shemyak 84bee58c24 crypt.3: Add description of previously undocumented 'rounds' parameter
Files crypt/sha{256,512}-crypt.c in the glibc source define
macros:

    /* Default number of rounds if not explicitly specified.  */
    #define ROUNDS_DEFAULT 5000
    /* Minimum number of rounds.  */
    #define ROUNDS_MIN 1000
    /* Maximum number of rounds.  */
    #define ROUNDS_MAX 999999999

And the main encryption function __sha512_crypt_r() sets:

    rounds = MAX (ROUNDS_MIN, MIN (srounds, ROUNDS_MAX));

One can check that for example

    crypt("key", "$5$rounds=1$salt")

returns the string

    $5$rounds=1000$salt$PWLKU7MTJ0s5M/mjBPcqnMsorm3qKyoBctxmZ1mNwn2

This parameter has been introduced in glibc 2.7.

Signed-off-by: Konstantin Shemyak <konstantin@shemyak.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-05 19:49:35 +02:00
Konstantin Shemyak d32b36982d crypt.3: Clarify that ending of the salt string with '$' is optional
In crypt/sha512-crypt.c::__sha512_crypt_r() and the similar
sha256 function, the length of the actually used salt is
calculated as:

  salt_len = MIN (strcspn (salt, "$"), SALT_LEN_MAX);

Thus the trailing '$' is optional in the salt string. One can
check that

    crypt("key", "$5$salt")

yields the same result as

    crypt("key", "$5$salt$").

Signed-off-by: Konstantin Shemyak <konstantin@shemyak.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-05 19:48:35 +02:00
Konstantin Shemyak 893c609dcd crypt.3: Encryption isn't done with SHA-xxx, but with a function based on SHA-xxx
The encryption is done by glibc functions __shaxxx_crypt_r() in
files crypt/shaxxx-crypt.c. They implement a nontrivial algorithm
to construct the inputs for the hashing functions and to apply
them iteratively.

Signed-off-by: Konstantin Shemyak <konstantin@shemyak.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-05 19:47:52 +02:00
Konstantin Shemyak 266d8f7ef1 crypt.3: ffix
Signed-off-by: Konstantin Shemyak <konstantin@shemyak.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-04 01:27:21 +02:00
Michael Kerrisk 0e840b4234 keyctl.2: Minor fixes to Eugene's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 13:27:56 +02:00
Eugene Syromyatnikov 54d5a1c72b keyctl.2: Document the KEYCTL_RESTRICT_KEYRING operation
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 13:18:44 +02:00
Michael Kerrisk 8a351f8497 getrlimit.2: Note that RLIMIT_AS and RLIMIT_DATA are rounded down to system page size
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 04:06:51 +02:00
Michael Kerrisk b50667ac6d getrlimit.2: Mention unit for RLIMIT_DATA
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:48:39 +02:00
Thiago Jung Bauermann 4a63f626b5 getrlimit.2: Mention unit used by RLIMIT_CORE and RLIMIT_FSIZE
It would have been obvious that these limits are in bytes, except that
"ulimit -a" in at least bash, dash and zsh says that they're in blocks.
This confused me, so I had to check the kernel source code.

My understanding is that they are indeed in bytes, so mention this
information in the man page.

Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:45:56 +02:00
Michael Kerrisk df81149955 keyctl.2: Minor fixes to Eugene's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:41:42 +02:00
Eugene Syromyatnikov a02cbc788b keyctl.2: Document the ability to provide KDF parameters in KEYCTL_DH_COMPUTE
Acked-by: Stephan Müller <smueller@chronox.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:28:50 +02:00
Eugene Syromyatnikov e937944e81 keyctl.2: Mention ENOMEM in ERRORS
This one is not very specific, as memory allocations are scattered across
the code, so let's put some generic description here.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:24:42 +02:00
Eugene Syromyatnikov 04630ce71c keyrings.7: Add pointers to kernel's documentation
Mostly because of assymmetric-keys.txt, which is outside
security/keys for some reason.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:19:48 +02:00
Michael Kerrisk 954be1b921 keyctl.2: Minor tweaks to Eugene's patch (mention old keys.txt file)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:18:48 +02:00
Michael Kerrisk f17b3bd8ee keyctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:17:52 +02:00
Eugene Syromyatnikov 514c8256cc keyctl.2: Update kernel documentation path reference
It has been changed in b68101a1e8f0263dbc7b8375d2a7c57c6216fb76
(Linux 4.13).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:16:46 +02:00
Eugene Syromyatnikov 8a156aca74 keyctl.2: wfix: change "is" to "was" in error descriptions
Since half of items used "was" and another half used "is".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:13:53 +02:00
Michael Kerrisk d7f23d0bd6 proc.5: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-03 02:12:25 +02:00