Commit Graph

10922 Commits

Author SHA1 Message Date
Heinrich Schuchardt 7a8110f6af inotify.7: munmap() does not generate inotify events
mmap() and msync() were already described as not leading to
inotify events. This patch adds munmap(). I created and executed
a test to verify this.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-26 10:16:05 +02:00
Michael Kerrisk 2483209a9c inotify.7: Minor changes to Heinrich Schuechardt's example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 23:07:08 +02:00
Heinrich Schuchardt ecd96f7c0e inotify.7: Add example program
This example of the usage of the inotify API shows the
usage of inotify_init1(2) and inotify_add_watch(2) as well
as polling and reading from the inotify file descriptor.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 22:42:29 +02:00
Michael Kerrisk 9fb49a3a80 locale.7: Tweaks to Marko Myllynen's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:42:20 +02:00
Marko Myllynen cd2b4f6efd locale.7: Document LOCPATH
Example from https://sourceware.org/glibc/wiki/Locales

After modifying a locale, make sure it compiles, and install it to a
temporary directory for testing:

  unset LC_ALL
  LOCALE=fi_FI
  export I18NPATH=$HOME/locale-test/
  export LOCPATH=$HOME/locale-test/
  mkdir -p $LOCPATH
  localedef --no-archive -f localedata/charmaps/UTF-8 -i localedata/locales/$LOCALE $I18NPATH/$LOCALE.UTF-8
  LC_TIME=$LOCALE.UTF-8 locale -ck LC_TIME
  LC_TIME=$LOCALE.UTF-8 locale -ck date_fmt
  LC_TIME=$LOCALE.UTF-8 date
  LC_CTYPE=$LOCALE.UTF-8 iconv -f UTF-8 -t ASCII//TRANSLIT < translit-test-input.txt
  LC_COLLATE=$LOCALE.UTF-8 sort < sorting-test-input.txt

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:36:13 +02:00
Marko Myllynen dbe0246bed nl_langinfo.3: expand the example code a bit
Better illustrate querying elements from different categories.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:28:25 +02:00
Michael Kerrisk 2f41dcabf1 locale.5: Minor rewordings
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:28:25 +02:00
Michael Kerrisk c33a849443 locale.5: Tweaks to Marko Myllynen's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:28:25 +02:00
Marko Myllynen b5d4168adf locale.5: Clarify LC_TIME/am_pm and LC_NAME keywords usage
am_pm should be defined only if AM/PM convention is used to signal
applications they should not try to print them when using them in
unwanted.

Same for all LC_NAME keywords expect for name_fmt which should be
always defined.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:28:25 +02:00
Michael Kerrisk d099bdc501 locale.7: Add further details on various categories
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:28:25 +02:00
Michael Kerrisk 348aab3724 setlocale.3: Simply locale category listing and add GNU-specific locale categories
Some information that was here will move to locale(7).

Reported-by: Marko Myllynen <myllynen@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:28:25 +02:00
Michael Kerrisk e0396d76b2 setlocale.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:28:25 +02:00
Marko Myllynen e6812b0dfd locale.5: Clarify lang_term / lang_lib
As noted by Keld Simonsen in the lib-locales@sourceware mailing
list:

    https://sourceware.org/ml/libc-locales/2014-q2/msg00008.html
    From: Keld Simonsen <keld at rap dot rap dot dk>
    To: Marko Myllynen <myllynen at redhat dot com>
    Date: Tue, 29 Apr 2014 17:02:09 +0200

    lang_term reflects ISO 639-2/T (terminology) codes, while
    lang_lib reflects ISO 639-2/B (bibliographic) codes.
    lang_term is preferred over lang_lib codes for locale names.
    There are 20 specific ISO 639-2/B codes.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:28:25 +02:00
Marko Myllynen 261ce50b66 setlocale.3: Remove now obsolete NOTES section
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-24 20:28:25 +02:00
Simon Paillard 11bae399cf shmget.2: wfix
The section is about failures, no need to recall this for that
specific error code.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-23 15:50:53 +02:00
Peng Haitao 13b792dcc2 pthread_setaffinity_np.3: ATTRIBUTES: Note functions that are thread-safe
The functions pthread_setaffinity_np() and
pthread_getaffinity_np() are thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-23 10:32:15 +02:00
Peng Haitao cb63c0fcd3 pthread_exit.3: ATTRIBUTES: Note function that is thread-safe
The function pthread_exit() is thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-23 08:49:42 +02:00
Peng Haitao 6b0949f0f1 pthread_equal.3: ATTRIBUTES: Note function that is thread-safe
The function pthread_equal() is thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-23 07:10:22 +02:00
Peng Haitao 949fea39cb pthread_getcpuclockid.3: ATTRIBUTES: Note function that is thread-safe
The function pthread_getcpuclockid() is thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-23 05:59:16 +02:00
Peng Haitao 3ef3728c9f pthread_setconcurrency.3: ATTRIBUTES: Note functions that are thread-safe
The functions pthread_setconcurrency() and
pthread_getconcurrency() are thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-23 05:58:35 +02:00
Heinrich Schuchardt 864eccb901 fanotify.7: fanotify_read should use aligned buffer
Michael Kerrisk pointed me to alignment issues which may
arise when reading misaligned integers.

On some systems integer values can only be read if they are
correctly aligned. Other system have a lower performance when
reading from or writing to misaligned memory positions.

Therefore, the buffer used to call read(2) for a fanotify
file descriptor should have the same alignment as
struct fanotify_event_metadata.

Due to the casting to char* inside the macros
FAN_EVENT_OK and FAN_EVENT_NEXT we can use any
data structure for the buffer.

With the patch an array of struct fanotify_event_metadata is
used as buffer which seems a natural choice to ensure proper
alignment.

It should be remembered that the offset between events is given
by field event_len and iterating over the array may not be
allowable in future. Instead the macros should be used.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:49:30 +02:00
Rasmus Villemoes da9a495eaa tsearch.3: Fix prototype
The rootp argument to tfind is "void * const *",
not "const void **".

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:28 +02:00
Rasmus Villemoes ecf9e5f83e scandir.3: Fix prototypes
The alphasort and versionsort functions take arguments of type const
struct dirent **, not const void *.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:28 +02:00
Rasmus Villemoes 0c5e1f653a resolver.3: Fix prototypes and extern-declaration
Fix const- and signedness of various char* parameters.

Also, there is no "struct state", but _res is a struct
__res_state. (Actually, _res is errno-like in that it is really a
macro expanding to (*__res_state()).)

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:28 +02:00
Rasmus Villemoes bc572b8fb3 key_setsecret.3: Fix prototypes
Remove const qualifiers from arguments to key_decryptsession,
key_encryptsession, and key_setsecret.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:28 +02:00
Rasmus Villemoes d928796115 xdr.3: tfix
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:28 +02:00
Rasmus Villemoes 60bc9dc21d getauxval.3: Fix permissions
There doesn't seem to be any reason for getauxval.3 to be
executable...

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:28 +02:00
Rasmus Villemoes d7f5fd1b79 setnetgrent.3: Fix prototype
The buflen argument to getnetgrent_r has type size_t.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:28 +02:00
Rasmus Villemoes 7accd93791 sigvec.3: Fix prototype
The vec argument to sigvec is const.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:28 +02:00
Rasmus Villemoes 7362924b39 rtime.3: Replace header
The header <rpc/des_crypt.h> does not provide rtime();
<rpc/auth_des.h> does, as is also implied in both the NOTES and
EXAMPLE sections.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:28 +02:00
Rasmus Villemoes 38cea4d1ff rexec.3: Fix prototypes
The user, passwd and cmd arguments to rexec and rexec_af are all
const.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 5ceebb5488 re_comp.3: Fix prototypes
re_comp and re_exec take const char* arguments.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes ed3ab3bd38 rcmd.3: Fix prototypes
Unlike the BSDs, the second argument of rcmd() and rcmd_af() has
type unsigned short.

The first argument of iruserok_af() has type const void*.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 1ac20a9e01 pthread_setschedprio.3: Fix prototype
Add return type for pthread_setschedprio.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 553c77668d pthread_setschedparam.3: Fix prototypes
Add return type for pthread_{s,g}etschedparam.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 3ea7055765 pthread_setname_np.3: Fix prototype
The name parameter of pthread_getname_np is an output parameter and
hence not const.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Michael Kerrisk cff17c1b64 pthread_cleanup_push_defer_np.3: Add feature test macro requirements
Reported-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes e59f5f584c pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3: Constify parameters
Each of the pthread_attr_get* functions extract some piece of
information from a pthread_attr_t, which is passed by const
reference. Add the const keyword to the prototypes of these
functions.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes d795791f2d pthread_sigqueue.3: Add missing #include <signal.h>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 6729be5418 perror.3: Fix declaration
The elements of the array sys_errlist are also const.

Also, it is probably not desirable to pretend that errno.h defines
errno in the traditional way (errno(3) correctly contains an explicit
warning against this). I don't know what the best solution is, though.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes b39c9a519c mq_getattr.3: Fix prototype
The newattr parameter to mq_setattr is const.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 7b7fbe7865 malloc_trim.3: Fix prototype
As mentioned further down, malloc_trim returns an integer.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes eb696b73e7 makedev.3: Fix prototype
gnu_dev_makedev, and hence its trivial macro wrapper makedev, takes
two unsigned int parameters; this is consistent with it being the
inverse of (gnu_dev_)major/minor, which return unsigned int.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes b7f0ef9ed6 makecontext.3: Fix prototype
The second argument to swapcontext() is const.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 92263c071c inet.3: Fix prototype
The parameters to inet_makeaddr have type in_addr_t.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 2548b25240 inet_net_pton.3: srcfix, cfix
Use a consistent style throughout the man-pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 236899f0ab swapon.2: Remove header from synopsis
The <asm/page.h> header is not readily available, and the comment
seems to indicate that it is for getting PAGE_SIZE. But it is
never mentioned why one would need to know that, and it is in any
case better obtained using sysconf(), provided by <unistd.h>.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes 8c7d2f0455 getrpcport.3: Add #include and fix prototype
The prototype for getrpcport() is obtained by #include'ing
<rpc/rpc.h>. Also, update its prototype.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes bf8f95ee9f getutent.3: Fix prototypes
The arguments to getutid(), getutline(), and pututline()
are const.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00
Rasmus Villemoes ff9ebfeb1e getspnam.3: Fix prototype
The struct spwd argument to putspent() is const.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-22 08:23:27 +02:00