diff options
Diffstat (limited to 'man3')
| -rw-r--r-- | man3/dlinfo.3 | 10 | ||||
| -rw-r--r-- | man3/duplocale.3 | 2 | ||||
| -rw-r--r-- | man3/fopencookie.3 | 10 | ||||
| -rw-r--r-- | man3/getgrouplist.3 | 6 | ||||
| -rw-r--r-- | man3/getifaddrs.3 | 6 | ||||
| -rw-r--r-- | man3/getprotoent_r.3 | 2 | ||||
| -rw-r--r-- | man3/getservent_r.3 | 2 | ||||
| -rw-r--r-- | man3/insque.3 | 8 | ||||
| -rw-r--r-- | man3/printf.3 | 6 | ||||
| -rw-r--r-- | man3/pthread_attr_init.3 | 4 | ||||
| -rw-r--r-- | man3/pthread_cancel.3 | 10 | ||||
| -rw-r--r-- | man3/pthread_create.3 | 16 | ||||
| -rw-r--r-- | man3/pthread_mutexattr_setrobust.3 | 2 | ||||
| -rw-r--r-- | man3/pthread_setaffinity_np.3 | 4 | ||||
| -rw-r--r-- | man3/qsort.3 | 2 | ||||
| -rw-r--r-- | man3/sem_wait.3 | 8 |
16 files changed, 48 insertions, 50 deletions
diff --git a/man3/dlinfo.3 b/man3/dlinfo.3 index beca4a1256..b1b9544106 100644 --- a/man3/dlinfo.3 +++ b/man3/dlinfo.3 @@ -277,7 +277,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Obtain a handle for shared object specified on command line */ + /* Obtain a handle for shared object specified on command line. */ handle = dlopen(argv[1], RTLD_NOW); if (handle == NULL) { @@ -286,14 +286,14 @@ main(int argc, char *argv[]) } /* Discover the size of the buffer that we must pass to - RTLD_DI_SERINFO */ + RTLD_DI_SERINFO. */ if (dlinfo(handle, RTLD_DI_SERINFOSIZE, &serinfo) == \-1) { fprintf(stderr, "RTLD_DI_SERINFOSIZE failed: %s\en", dlerror()); exit(EXIT_FAILURE); } - /* Allocate the buffer for use with RTLD_DI_SERINFO */ + /* Allocate the buffer for use with RTLD_DI_SERINFO. */ sip = malloc(serinfo.dls_size); if (sip == NULL) { @@ -302,14 +302,14 @@ main(int argc, char *argv[]) } /* Initialize the \(aqdls_size\(aq and \(aqdls_cnt\(aq fields in the newly - allocated buffer */ + allocated buffer. */ if (dlinfo(handle, RTLD_DI_SERINFOSIZE, sip) == \-1) { fprintf(stderr, "RTLD_DI_SERINFOSIZE failed: %s\en", dlerror()); exit(EXIT_FAILURE); } - /* Fetch and print library search list */ + /* Fetch and print library search list. */ if (dlinfo(handle, RTLD_DI_SERINFO, sip) == \-1) { fprintf(stderr, "RTLD_DI_SERINFO failed: %s\en", dlerror()); diff --git a/man3/duplocale.3 b/man3/duplocale.3 index ae67d4b34f..1d8589e1b9 100644 --- a/man3/duplocale.3 +++ b/man3/duplocale.3 @@ -156,7 +156,7 @@ main(int argc, char *argv[]) /* This sequence is necessary, because uselocale() might return the value LC_GLOBAL_LOCALE, which can\(aqt be passed as an - argument to toupper_l() */ + argument to toupper_l(). */ loc = uselocale((locale_t) 0); if (loc == (locale_t) 0) diff --git a/man3/fopencookie.3 b/man3/fopencookie.3 index a47e5fe808..d3960a4061 100644 --- a/man3/fopencookie.3 +++ b/man3/fopencookie.3 @@ -305,7 +305,7 @@ memfile_write(void *c, const char *buf, size_t size) char *new_buff; struct memfile_cookie *cookie = c; - /* Buffer too small? Keep doubling size until big enough */ + /* Buffer too small? Keep doubling size until big enough. */ while (size + cookie\->offset > cookie\->allocated) { new_buff = realloc(cookie\->buf, cookie\->allocated * 2); @@ -332,7 +332,7 @@ memfile_read(void *c, char *buf, size_t size) ssize_t xbytes; struct memfile_cookie *cookie = c; - /* Fetch minimum of bytes requested and bytes available */ + /* Fetch minimum of bytes requested and bytes available. */ xbytes = size; if (cookie\->offset + size > cookie\->endpos) @@ -395,7 +395,7 @@ main(int argc, char *argv[]) size_t nread; char buf[1000]; - /* Set up the cookie before calling fopencookie() */ + /* Set up the cookie before calling fopencookie(). */ mycookie.buf = malloc(INIT_BUF_SIZE); if (mycookie.buf == NULL) { @@ -413,7 +413,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Write command\-line arguments to our file */ + /* Write command\-line arguments to our file. */ for (int j = 1; j < argc; j++) if (fputs(argv[j], stream) == EOF) { @@ -421,7 +421,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Read two bytes out of every five, until EOF */ + /* Read two bytes out of every five, until EOF. */ for (long p = 0; ; p += 5) { if (fseek(stream, p, SEEK_SET) == \-1) { diff --git a/man3/getgrouplist.3 b/man3/getgrouplist.3 index 225abe29f9..7ac04a9332 100644 --- a/man3/getgrouplist.3 +++ b/man3/getgrouplist.3 @@ -169,7 +169,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Fetch passwd structure (contains first group ID for user) */ + /* Fetch passwd structure (contains first group ID for user). */ pw = getpwnam(argv[1]); if (pw == NULL) { @@ -177,7 +177,7 @@ main(int argc, char *argv[]) exit(EXIT_SUCCESS); } - /* Retrieve group list */ + /* Retrieve group list. */ if (getgrouplist(argv[1], pw\->pw_gid, groups, &ngroups) == \-1) { fprintf(stderr, "getgrouplist() returned \-1; ngroups = %d\en", @@ -185,7 +185,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Display list of retrieved groups, along with group names */ + /* Display list of retrieved groups, along with group names. */ fprintf(stderr, "ngroups = %d\en", ngroups); for (int j = 0; j < ngroups; j++) { diff --git a/man3/getifaddrs.3 b/man3/getifaddrs.3 index 1eece18518..7e235896c7 100644 --- a/man3/getifaddrs.3 +++ b/man3/getifaddrs.3 @@ -273,7 +273,7 @@ int main(int argc, char *argv[]) } /* Walk through linked list, maintaining head pointer so we - can free list later */ + can free list later. */ for (struct ifaddrs *ifa = ifaddr; ifa != NULL; ifa = ifa\->ifa_next) { @@ -283,7 +283,7 @@ int main(int argc, char *argv[]) family = ifa\->ifa_addr\->sa_family; /* Display interface name and family (including symbolic - form of the latter for the common families) */ + form of the latter for the common families). */ printf("%\-8s %s (%d)\en", ifa\->ifa_name, @@ -292,7 +292,7 @@ int main(int argc, char *argv[]) (family == AF_INET6) ? "AF_INET6" : "???", family); - /* For an AF_INET* interface address, display the address */ + /* For an AF_INET* interface address, display the address. */ if (family == AF_INET || family == AF_INET6) { s = getnameinfo(ifa\->ifa_addr, diff --git a/man3/getprotoent_r.3 b/man3/getprotoent_r.3 index eb31a3d422..c98764a4e0 100644 --- a/man3/getprotoent_r.3 +++ b/man3/getprotoent_r.3 @@ -222,7 +222,7 @@ main(int argc, char *argv[]) erange_cnt++; /* Increment a byte at a time so we can see exactly - what size buffer was required */ + what size buffer was required. */ buflen++; diff --git a/man3/getservent_r.3 b/man3/getservent_r.3 index 282e89c9c4..f0c84e6a21 100644 --- a/man3/getservent_r.3 +++ b/man3/getservent_r.3 @@ -224,7 +224,7 @@ main(int argc, char *argv[]) erange_cnt++; /* Increment a byte at a time so we can see exactly - what size buffer was required */ + what size buffer was required. */ buflen++; diff --git a/man3/insque.3 b/man3/insque.3 index 6a1614a81a..cf46b5ed43 100644 --- a/man3/insque.3 +++ b/man3/insque.3 @@ -196,7 +196,7 @@ main(int argc, char *argv[]) int circular, opt, errfnd; /* The "\-c" command\-line option can be used to specify that the - list is circular */ + list is circular. */ errfnd = 0; circular = 0; @@ -216,7 +216,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Create first element and place it in the linked list */ + /* Create first element and place it in the linked list. */ elem = new_element(); first = elem; @@ -231,7 +231,7 @@ main(int argc, char *argv[]) insque(elem, NULL); } - /* Add remaining command\-line arguments as list elements */ + /* Add remaining command\-line arguments as list elements. */ while (++optind < argc) { prev = elem; @@ -241,7 +241,7 @@ main(int argc, char *argv[]) insque(elem, prev); } - /* Traverse the list from the start, printing element names */ + /* Traverse the list from the start, printing element names. */ printf("Traversing completed list:\en"); elem = first; diff --git a/man3/printf.3 b/man3/printf.3 index 946a591a5b..69977ae76f 100644 --- a/man3/printf.3 +++ b/man3/printf.3 @@ -1139,7 +1139,7 @@ make_message(const char *fmt, ...) char *p = NULL; va_list ap; - /* Determine required size */ + /* Determine required size. */ va_start(ap, fmt); n = vsnprintf(p, size, fmt, ap); @@ -1148,9 +1148,7 @@ make_message(const char *fmt, ...) if (n < 0) return NULL; - /* One extra byte for \(aq\e0\(aq */ - - size = (size_t) n + 1; + size = (size_t) n + 1; /* One extra byte for \(aq\e0\(aq */ p = malloc(size); if (p == NULL) return NULL; diff --git a/man3/pthread_attr_init.3 b/man3/pthread_attr_init.3 index 754ab41658..6d8751913c 100644 --- a/man3/pthread_attr_init.3 +++ b/man3/pthread_attr_init.3 @@ -239,7 +239,7 @@ thread_start(void *arg) /* pthread_getattr_np() is a non\-standard GNU extension that retrieves the attributes of the thread specified in its - first argument */ + first argument. */ s = pthread_getattr_np(pthread_self(), &gattr); if (s != 0) @@ -263,7 +263,7 @@ main(int argc, char *argv[]) /* If a command\-line argument was supplied, use it to set the stack\-size attribute and set a few other thread attributes, - and set attrp pointing to thread attributes object */ + and set attrp pointing to thread attributes object. */ if (argc > 1) { size_t stack_size; diff --git a/man3/pthread_cancel.3 b/man3/pthread_cancel.3 index 6f1fd8e8a8..5df20d17a6 100644 --- a/man3/pthread_cancel.3 +++ b/man3/pthread_cancel.3 @@ -179,7 +179,7 @@ thread_func(void *ignored_argument) int s; /* Disable cancellation for a while, so that we don\(aqt - immediately react to a cancellation request */ + immediately react to a cancellation request. */ s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); if (s != 0) @@ -193,11 +193,11 @@ thread_func(void *ignored_argument) if (s != 0) handle_error_en(s, "pthread_setcancelstate"); - /* sleep() is a cancellation point */ + /* sleep() is a cancellation point. */ sleep(1000); /* Should get canceled while we sleep */ - /* Should never get here */ + /* Should never get here. */ printf("thread_func(): not canceled!\en"); return NULL; @@ -210,7 +210,7 @@ main(void) void *res; int s; - /* Start a thread and then send it a cancellation request */ + /* Start a thread and then send it a cancellation request. */ s = pthread_create(&thr, NULL, &thread_func, NULL); if (s != 0) @@ -223,7 +223,7 @@ main(void) if (s != 0) handle_error_en(s, "pthread_cancel"); - /* Join with thread to see what its exit status was */ + /* Join with thread to see what its exit status was. */ s = pthread_join(thr, &res); if (s != 0) diff --git a/man3/pthread_create.3 b/man3/pthread_create.3 index a86cbf0e20..e96965be3b 100644 --- a/man3/pthread_create.3 +++ b/man3/pthread_create.3 @@ -299,7 +299,7 @@ struct thread_info { /* Used as argument to thread_start() */ }; /* Thread start function: display address near top of our stack, - and return upper\-cased copy of argv_string */ + and return upper\-cased copy of argv_string. */ static void * thread_start(void *arg) @@ -328,7 +328,7 @@ main(int argc, char *argv[]) size_t stack_size; void *res; - /* The "\-s" option specifies a stack size for our threads */ + /* The "\-s" option specifies a stack size for our threads. */ stack_size = \-1; while ((opt = getopt(argc, argv, "s:")) != \-1) { @@ -346,7 +346,7 @@ main(int argc, char *argv[]) num_threads = argc \- optind; - /* Initialize thread creation attributes */ + /* Initialize thread creation attributes. */ s = pthread_attr_init(&attr); if (s != 0) @@ -358,20 +358,20 @@ main(int argc, char *argv[]) handle_error_en(s, "pthread_attr_setstacksize"); } - /* Allocate memory for pthread_create() arguments */ + /* Allocate memory for pthread_create() arguments. */ struct thread_info *tinfo = calloc(num_threads, sizeof(*tinfo)); if (tinfo == NULL) handle_error("calloc"); - /* Create one thread for each command\-line argument */ + /* Create one thread for each command\-line argument. */ for (int tnum = 0; tnum < num_threads; tnum++) { tinfo[tnum].thread_num = tnum + 1; tinfo[tnum].argv_string = argv[optind + tnum]; /* The pthread_create() call stores the thread ID into - corresponding element of tinfo[] */ + corresponding element of tinfo[]. */ s = pthread_create(&tinfo[tnum].thread_id, &attr, &thread_start, &tinfo[tnum]); @@ -380,13 +380,13 @@ main(int argc, char *argv[]) } /* Destroy the thread attributes object, since it is no - longer needed */ + longer needed. */ s = pthread_attr_destroy(&attr); if (s != 0) handle_error_en(s, "pthread_attr_destroy"); - /* Now join with each thread, and display its returned value */ + /* Now join with each thread, and display its returned value. */ for (int tnum = 0; tnum < num_threads; tnum++) { s = pthread_join(tinfo[tnum].thread_id, &res); diff --git a/man3/pthread_mutexattr_setrobust.3 b/man3/pthread_mutexattr_setrobust.3 index 50d115614f..d94fe9d385 100644 --- a/man3/pthread_mutexattr_setrobust.3 +++ b/man3/pthread_mutexattr_setrobust.3 @@ -248,7 +248,7 @@ main(int argc, char *argv[]) sleep(2); - /* "original_owner_thread" should have exited by now */ + /* "original_owner_thread" should have exited by now. */ printf("[main] Attempting to lock the robust mutex.\en"); s = pthread_mutex_lock(&mtx); diff --git a/man3/pthread_setaffinity_np.3 b/man3/pthread_setaffinity_np.3 index ce2d05fda8..a4dab17c43 100644 --- a/man3/pthread_setaffinity_np.3 +++ b/man3/pthread_setaffinity_np.3 @@ -188,7 +188,7 @@ main(int argc, char *argv[]) thread = pthread_self(); - /* Set affinity mask to include CPUs 0 to 7 */ + /* Set affinity mask to include CPUs 0 to 7. */ CPU_ZERO(&cpuset); for (int j = 0; j < 8; j++) @@ -198,7 +198,7 @@ main(int argc, char *argv[]) if (s != 0) handle_error_en(s, "pthread_setaffinity_np"); - /* Check the actual affinity mask assigned to the thread */ + /* Check the actual affinity mask assigned to the thread. */ s = pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset); if (s != 0) diff --git a/man3/qsort.3 b/man3/qsort.3 index 60f5d8ef9f..b0d9c43eff 100644 --- a/man3/qsort.3 +++ b/man3/qsort.3 @@ -135,7 +135,7 @@ cmpstringp(const void *p1, const void *p2) { /* The actual arguments to this function are "pointers to pointers to char", but strcmp(3) arguments are "pointers - to char", hence the following cast plus dereference */ + to char", hence the following cast plus dereference. */ return strcmp(*(const char **) p1, *(const char **) p2); } diff --git a/man3/sem_wait.3 b/man3/sem_wait.3 index 3f7bacf91e..b7edd1654b 100644 --- a/man3/sem_wait.3 +++ b/man3/sem_wait.3 @@ -228,7 +228,7 @@ main(int argc, char *argv[]) if (sem_init(&sem, 0, 0) == \-1) handle_error("sem_init"); - /* Establish SIGALRM handler; set alarm timer using argv[1] */ + /* Establish SIGALRM handler; set alarm timer using argv[1]. */ sa.sa_handler = handler; sigemptyset(&sa.sa_mask); @@ -239,7 +239,7 @@ main(int argc, char *argv[]) alarm(atoi(argv[1])); /* Calculate relative interval as current time plus - number of seconds given argv[2] */ + number of seconds given argv[2]. */ if (clock_gettime(CLOCK_REALTIME, &ts) == \-1) handle_error("clock_gettime"); @@ -248,9 +248,9 @@ main(int argc, char *argv[]) printf("main() about to call sem_timedwait()\en"); while ((s = sem_timedwait(&sem, &ts)) == \-1 && errno == EINTR) - continue; /* Restart if interrupted by handler */ + continue; /* Restart if interrupted by handler. */ - /* Check what happened */ + /* Check what happened. */ if (s == \-1) { if (errno == ETIMEDOUT) |
