]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
ioctl_ns.2, keyctl.2, memfd_create.2, pidfd_send_signal.2, poll.2, seccomp.2, signalf...
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 27 Dec 2020 10:42:50 +0000 (11:42 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 27 Dec 2020 11:32:44 +0000 (12:32 +0100)
In general, complete sentences in free-standing comments
should be terminated by periods.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
32 files changed:
man2/ioctl_ns.2
man2/keyctl.2
man2/memfd_create.2
man2/pidfd_send_signal.2
man2/poll.2
man2/seccomp.2
man2/signalfd.2
man2/timerfd_create.2
man2/unshare.2
man3/dlinfo.3
man3/duplocale.3
man3/fopencookie.3
man3/getgrouplist.3
man3/getifaddrs.3
man3/getprotoent_r.3
man3/getservent_r.3
man3/insque.3
man3/printf.3
man3/pthread_attr_init.3
man3/pthread_cancel.3
man3/pthread_create.3
man3/pthread_mutexattr_setrobust.3
man3/pthread_setaffinity_np.3
man3/qsort.3
man3/sem_wait.3
man5/core.5
man5/elf.5
man7/aio.7
man7/epoll.7
man7/pkeys.7
man7/system_data_types.7
man7/unix.7

index 8aaf2e6e095ccab1b904fb8c3ee6e3968a33d9f9..5611be0efe64f0bf80aa85bef5679431e9a71dd2 100644 (file)
@@ -289,7 +289,7 @@ main(int argc, char *argv[])
     }
 
     /* Obtain a file descriptor for the \(aqns\(aq file specified
-       in argv[1] */
+       in argv[1]. */
 
     fd = open(argv[1], O_RDONLY);
     if (fd == \-1) {
@@ -298,7 +298,7 @@ main(int argc, char *argv[])
     }
 
     /* Obtain a file descriptor for the owning user namespace and
-       then obtain and display the inode number of that namespace */
+       then obtain and display the inode number of that namespace. */
 
     if (argc < 3 || strchr(argv[2], \(aqu\(aq)) {
         userns_fd = ioctl(fd, NS_GET_USERNS);
@@ -326,7 +326,7 @@ main(int argc, char *argv[])
     }
 
     /* Obtain a file descriptor for the parent namespace and
-       then obtain and display the inode number of that namespace */
+       then obtain and display the inode number of that namespace. */
 
     if (argc > 2 && strchr(argv[2], \(aqp\(aq)) {
         parent_fd = ioctl(fd, NS_GET_PARENT);
index daf889797710a43f089eab94a9f23d3cc6f4409b..6bf07972dabd67322f4ed3582590b6040c62d5bc 100644 (file)
@@ -2143,7 +2143,7 @@ main(int argc, char *argv[])
     fprintf(fp, "\en");
 
     /*
-     * Assume the authority to instantiate the key named in argv[2]
+     * Assume the authority to instantiate the key named in argv[2].
      */
     if (keyctl(KEYCTL_ASSUME_AUTHORITY, key_to_instantiate) == \-1) {
         fprintf(fp, "KEYCTL_ASSUME_AUTHORITY failed: %s\en",
@@ -2152,7 +2152,7 @@ main(int argc, char *argv[])
     }
 
     /*
-     * Fetch the description of the key that is to be instantiated
+     * Fetch the description of the key that is to be instantiated.
      */
     if (keyctl(KEYCTL_DESCRIBE, key_to_instantiate,
                 dbuf, sizeof(dbuf)) == \-1) {
@@ -2164,7 +2164,7 @@ main(int argc, char *argv[])
 
     /*
      * Fetch the payload of the authorization key, which is
-     * actually the callout data given to request_key()
+     * actually the callout data given to request_key().
      */
     akp_size = keyctl(KEYCTL_READ, KEY_SPEC_REQKEY_AUTH_KEY,
                       auth_key_payload, sizeof(auth_key_payload));
index 49e1ad021b4b6686b14641262dcdd5005df78e32..6d476afb3b9f3cec181b09c0dbf21b579607374d 100644 (file)
@@ -445,13 +445,13 @@ main(int argc, char *argv[])
     seals_arg = argv[3];
 
     /* Create an anonymous file in tmpfs; allow seals to be
-       placed on the file */
+       placed on the file. */
 
     fd = memfd_create(name, MFD_ALLOW_SEALING);
     if (fd == \-1)
         errExit("memfd_create");
 
-    /* Size the file as specified on the command line */
+    /* Size the file as specified on the command line. */
 
     if (ftruncate(fd, len) == \-1)
         errExit("truncate");
@@ -460,10 +460,10 @@ main(int argc, char *argv[])
             (intmax_t) getpid(), fd, (intmax_t) getpid(), fd);
 
     /* Code to map the file and populate the mapping with data
-       omitted */
+       omitted. */
 
     /* If a \(aqseals\(aq command\-line argument was supplied, set some
-       seals on the file */
+       seals on the file. */
 
     if (seals_arg != NULL) {
         seals = 0;
@@ -484,7 +484,7 @@ main(int argc, char *argv[])
     }
 
     /* Keep running, so that the file created by memfd_create()
-       continues to exist */
+       continues to exist. */
 
     pause();
 
@@ -538,7 +538,7 @@ main(int argc, char *argv[])
     printf("\en");
 
     /* Code to map the file and access the contents of the
-       resulting mapping omitted */
+       resulting mapping omitted. */
 
     exit(EXIT_SUCCESS);
 }
index ebc91f7d9728b8edf6a32a0727e34b0dd8670b57..6670cf3579bd403ec61d1043377ad87b6d6dc022 100644 (file)
@@ -214,7 +214,7 @@ main(int argc, char *argv[])
     sig = atoi(argv[2]);
 
     /* Obtain a PID file descriptor by opening the /proc/PID directory
-       of the target process */
+       of the target process. */
 
     snprintf(path, sizeof(path), "/proc/%s", argv[1]);
 
@@ -225,7 +225,7 @@ main(int argc, char *argv[])
     }
 
     /* Populate a \(aqsiginfo_t\(aq structure for use with
-       pidfd_send_signal() */
+       pidfd_send_signal(). */
 
     memset(&info, 0, sizeof(info));
     info.si_code = SI_QUEUE;
@@ -235,7 +235,7 @@ main(int argc, char *argv[])
     info.si_pid = getpid();
     info.si_value.sival_int = 1234;
 
-    /* Send the signal */
+    /* Send the signal. */
 
     if (pidfd_send_signal(pidfd, sig, &info, 0) == \-1) {
         perror("pidfd_send_signal");
index b91418aaa18d90d5f9cc8eac8457f235b52f858a..b45e37f8a5932e551b415fc70fd5aeecb68dc154 100644 (file)
@@ -600,7 +600,7 @@ main(int argc, char *argv[])
     if (pfds == NULL)
         errExit("malloc");
 
-    /* Open each file on command line, and add it \(aqpfds\(aq array */
+    /* Open each file on command line, and add it \(aqpfds\(aq array. */
 
     for (int j = 0; j < nfds; j++) {
         pfds[j].fd = open(argv[j + 1], O_RDONLY);
@@ -613,7 +613,7 @@ main(int argc, char *argv[])
     }
 
     /* Keep calling poll() as long as at least one file descriptor is
-       open */
+       open. */
 
     while (num_open_fds > 0) {
         int ready;
@@ -625,7 +625,7 @@ main(int argc, char *argv[])
 
         printf("Ready: %d\en", ready);
 
-        /* Deal with array returned by poll() */
+        /* Deal with array returned by poll(). */
 
         for (int j = 0; j < nfds; j++) {
             char buf[10];
index 96d18b58e90b6fc36641549bc86e7d02bd07d601..6ac890a2f6a10f83602bc03bf61b9e8256fdf0e0 100644 (file)
@@ -1064,44 +1064,44 @@ install_filter(int syscall_nr, int t_arch, int f_errno)
 
     /* Assume that AUDIT_ARCH_X86_64 means the normal x86-64 ABI
        (in the x32 ABI, all system calls have bit 30 set in the
-       \(aqnr\(aq field, meaning the numbers are >= X32_SYSCALL_BIT) */
+       \(aqnr\(aq field, meaning the numbers are >= X32_SYSCALL_BIT). */
     if (t_arch == AUDIT_ARCH_X86_64)
         upper_nr_limit = X32_SYSCALL_BIT - 1;
 
     struct sock_filter filter[] = {
         /* [0] Load architecture from \(aqseccomp_data\(aq buffer into
-               accumulator */
+               accumulator. */
         BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
                  (offsetof(struct seccomp_data, arch))),
 
         /* [1] Jump forward 5 instructions if architecture does not
-               match \(aqt_arch\(aq */
+               match \(aqt_arch\(aq. */
         BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, t_arch, 0, 5),
 
         /* [2] Load system call number from \(aqseccomp_data\(aq buffer into
-               accumulator */
+               accumulator. */
         BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
                  (offsetof(struct seccomp_data, nr))),
 
         /* [3] Check ABI - only needed for x86-64 in deny-list use
                cases.  Use BPF_JGT instead of checking against the bit
-               mask to avoid having to reload the syscall number */
+               mask to avoid having to reload the syscall number. */
         BPF_JUMP(BPF_JMP | BPF_JGT | BPF_K, upper_nr_limit, 3, 0),
 
         /* [4] Jump forward 1 instruction if system call number
-               does not match \(aqsyscall_nr\(aq */
+               does not match \(aqsyscall_nr\(aq. */
         BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, syscall_nr, 0, 1),
 
         /* [5] Matching architecture and system call: don\(aqt execute
-           the system call, and return \(aqf_errno\(aq in \(aqerrno\(aq */
+           the system call, and return \(aqf_errno\(aq in \(aqerrno\(aq. */
         BPF_STMT(BPF_RET | BPF_K,
                  SECCOMP_RET_ERRNO | (f_errno & SECCOMP_RET_DATA)),
 
         /* [6] Destination of system call number mismatch: allow other
-               system calls */
+               system calls. */
         BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),
 
-        /* [7] Destination of architecture mismatch: kill process */
+        /* [7] Destination of architecture mismatch: kill process. */
         BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_KILL_PROCESS),
     };
 
index d9e0bbb5bea1942ac545ba3d902c0451bbd8b1dc..a22f840d981d671bc68bdcda8aaf4970bea40074 100644 (file)
@@ -492,7 +492,7 @@ main(int argc, char *argv[])
     sigaddset(&mask, SIGQUIT);
 
     /* Block signals so that they aren\(aqt handled
-       according to their default dispositions */
+       according to their default dispositions. */
 
     if (sigprocmask(SIG_BLOCK, &mask, NULL) == \-1)
         handle_error("sigprocmask");
index 80f280ce14d10b4e53aac9b3a3058b5b4887e9f4..0fe734b615c55b5d6e85350062ecec82d7e1bc36 100644 (file)
@@ -677,7 +677,7 @@ main(int argc, char *argv[])
         handle_error("clock_gettime");
 
     /* Create a CLOCK_REALTIME absolute timer with initial
-       expiration and interval as specified in command line */
+       expiration and interval as specified in command line. */
 
     new_value.it_value.tv_sec = now.tv_sec + atoi(argv[1]);
     new_value.it_value.tv_nsec = now.tv_nsec;
index 5815e1f6cdcc82648e237dfb1045eac2ddce8900..a4c6601d51d59014bb73aeeec25438989ad2b714 100644 (file)
@@ -498,7 +498,7 @@ commands shows that the two shells are in different mount namespaces.
 #include <stdio.h>
 
 /* A simple error\-handling function: print an error message based
-   on the value in \(aqerrno\(aq and terminate the calling process */
+   on the value in \(aqerrno\(aq and terminate the calling process. */
 
 #define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \e
                         } while (0)
index beca4a125696039e220babe55a52df6471dccc4c..b1b9544106cbabfb23ec2a3876051de4c89ef99f 100644 (file)
@@ -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());
index ae67d4b34f3021510946a404d2a1f590e47c5f5a..1d8589e1b9eea4f2e6641f748ed5e6f22c7ec14d 100644 (file)
@@ -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)
index a47e5fe80893d00d03365b7571241a74df8f3c17..d3960a40615f9ad9d42e5dbcfe5f4b6a6fda9643 100644 (file)
@@ -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) {
index 225abe29f9c33828360849553df83cbd0f5e9dc8..7ac04a9332cabd6ef99e5a681a4198dd2e7047f1 100644 (file)
@@ -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++) {
index 1eece185187bd3b7d9b096debbc3485cdef79d2c..7e235896c76603ec7354dbbf02d661ef9d539917 100644 (file)
@@ -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,
index eb31a3d42222a9b6f530303f1627341bd6c87c5c..c98764a4e0452e9d456411833a9079f54d1222b5 100644 (file)
@@ -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++;
 
index 282e89c9c45c12338dbd419a507ab880ca760166..f0c84e6a21985c298c57c74f9923487837b49ed8 100644 (file)
@@ -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++;
 
index 6a1614a81ae9cb64b66efb51f15a2d2f0a111203..cf46b5ed43f03ed830239eae085807dbf98da910 100644 (file)
@@ -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;
index 946a591a5b002631bfe155244a4d07207286c102..69977ae76f48d70c9269097b1867d2ba2e0b7959 100644 (file)
@@ -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;
index 754ab41658d54845faff7c5842825f38088e7409..6d8751913cecfb438f18b737ee14e2c529a9e130 100644 (file)
@@ -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;
index 6f1fd8e8a8c22abf801b2eb08a028b684ff39e79..5df20d17a68682969cd265b04a8a1b5aaba1efc7 100644 (file)
@@ -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)
index a86cbf0e203ec7203d1bddcf175fa99b35cf24ec..e96965be3bb552069efa03b5f2e5795a744c4a82 100644 (file)
@@ -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);
index 50d115614ffa1c45bb8df1de5ae3a4aee6029131..d94fe9d385b0c402cfe6427d07e16704b5ff2ed2 100644 (file)
@@ -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);
index ce2d05fda8dddc163f91a96b45154c07c8ed5298..a4dab17c4380dee76c7c38536291b8e5aa418b7c 100644 (file)
@@ -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)
index 60f5d8ef9f4ba85070e50b9197d255f10fdc1da1..b0d9c43eff778058ffe51470aab34f83dce60f88 100644 (file)
@@ -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);
 }
index 3f7bacf91ea0bed492db450b0206d120612000f0..b7edd1654bac087cb3e4e632123b5dc38eabc557 100644 (file)
@@ -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)
index 22150714c34ef3ffe7baf5138b9ebecd3e6b581e..ebe95c77b745e671ca988fed2f2cfcf35cb7dc5d 100644 (file)
@@ -657,25 +657,25 @@ main(int argc, char *argv[])
     char cwd[PATH_MAX];
 
     /* Change our current working directory to that of the
-       crashing process */
+       crashing process. */
 
     snprintf(cwd, PATH_MAX, "/proc/%s/cwd", argv[1]);
     chdir(cwd);
 
-    /* Write output to file "core.info" in that directory */
+    /* Write output to file "core.info" in that directory. */
 
     fp = fopen("core.info", "w+");
     if (fp == NULL)
         exit(EXIT_FAILURE);
 
     /* Display command\-line arguments given to core_pattern
-       pipe program */
+       pipe program. */
 
     fprintf(fp, "argc=%d\en", argc);
     for (int j = 0; j < argc; j++)
         fprintf(fp, "argc[%d]=<%s>\en", j, argv[j]);
 
-    /* Count bytes in standard input (the core dump) */
+    /* Count bytes in standard input (the core dump). */
 
     tot = 0;
     while ((nread = read(STDIN_FILENO, buf, BUF_SIZE)) > 0)
index f28966c8f71c07c3f122dbc25b2019107a069350..8425f66148c46ec387bbe4ba97aaea3c41e44f86 100644 (file)
@@ -1867,19 +1867,19 @@ in memory:
 void *memory, *name, *desc;
 Elf64_Nhdr *note, *next_note;
 
-/* The buffer is pointing to the start of the section/segment */
+/* The buffer is pointing to the start of the section/segment. */
 note = memory;
 
-/* If the name is defined, it follows the note */
+/* If the name is defined, it follows the note. */
 name = note->n_namesz == 0 ? NULL : memory + sizeof(*note);
 
 /* If the descriptor is defined, it follows the name
-   (with alignment) */
+   (with alignment). */
 
 desc = note->n_descsz == 0 ? NULL :
        memory + sizeof(*note) + ALIGN_UP(note->n_namesz, 4);
 
-/* The next note follows both (with alignment) */
+/* The next note follows both (with alignment). */
 next_note = memory + sizeof(*note) +
                      ALIGN_UP(note->n_namesz, 4) +
                      ALIGN_UP(note->n_descsz, 4);
index 9b2c44c48f43d6d85220f597af516aeca58c5b27..d87c4b8785a10889352d121a752d8123d4b0ecf2 100644 (file)
@@ -305,7 +305,7 @@ main(int argc, char *argv[])
 
     numReqs = argc \- 1;
 
-    /* Allocate our arrays */
+    /* Allocate our arrays. */
 
     struct ioRequest *ioList = calloc(numReqs, sizeof(*ioList));
     if (ioList == NULL)
@@ -315,7 +315,7 @@ main(int argc, char *argv[])
     if (aiocbList == NULL)
         errExit("calloc");
 
-    /* Establish handlers for SIGQUIT and the I/O completion signal */
+    /* Establish handlers for SIGQUIT and the I/O completion signal. */
 
     sa.sa_flags = SA_RESTART;
     sigemptyset(&sa.sa_mask);
@@ -330,7 +330,7 @@ main(int argc, char *argv[])
         errExit("sigaction");
 
     /* Open each file specified on the command line, and queue
-       a read request on the resulting file descriptor */
+       a read request on the resulting file descriptor. */
 
     for (int j = 0; j < numReqs; j++) {
         ioList[j].reqNum = j;
@@ -362,7 +362,7 @@ main(int argc, char *argv[])
 
     openReqs = numReqs;
 
-    /* Loop, monitoring status of I/O requests */
+    /* Loop, monitoring status of I/O requests. */
 
     while (openReqs > 0) {
         sleep(3);       /* Delay between each monitoring step */
@@ -371,7 +371,7 @@ main(int argc, char *argv[])
 
             /* On receipt of SIGQUIT, attempt to cancel each of the
                outstanding I/O requests, and display status returned
-               from the cancellation requests */
+               from the cancellation requests. */
 
             printf("got SIGQUIT; canceling I/O requests: \en");
 
@@ -396,7 +396,7 @@ main(int argc, char *argv[])
         }
 
         /* Check the status of each I/O request that is still
-           in progress */
+           in progress. */
 
         printf("aio_error():\en");
         for (int j = 0; j < numReqs; j++) {
@@ -428,7 +428,7 @@ main(int argc, char *argv[])
 
     printf("All I/O requests completed\en");
 
-    /* Check status return of all I/O requests */
+    /* Check status return of all I/O requests. */
 
     printf("aio_return():\en");
     for (int j = 0; j < numReqs; j++) {
index 6c61f9e159e0d784eae8fac1d67bd90e7db4a1aa..3e823376c029da15f867eebc15122c71860301e1 100644 (file)
@@ -304,7 +304,7 @@ struct epoll_event ev, events[MAX_EVENTS];
 int listen_sock, conn_sock, nfds, epollfd;
 
 /* Code to set up listening socket, \(aqlisten_sock\(aq,
-   (socket(), bind(), listen()) omitted */
+   (socket(), bind(), listen()) omitted. */
 
 epollfd = epoll_create1(0);
 if (epollfd == \-1) {
index d7480177645bfd2f4b9d34959969df681252c0d0..5f0cd5d3a6b58367c5959793a5c57d3eeb4e0310 100644 (file)
@@ -237,7 +237,7 @@ main(void)
     int *buffer;
 
     /*
-     *Allocate one page of memory
+     * Allocate one page of memory.
      */
     buffer = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE,
                   MAP_ANONYMOUS | MAP_PRIVATE, \-1, 0);
@@ -245,7 +245,7 @@ main(void)
         errExit("mmap");
 
     /*
-     * Put some random data into the page (still OK to touch)
+     * Put some random data into the page (still OK to touch).
      */
     *buffer = __LINE__;
     printf("buffer contains: %d\en", *buffer);
@@ -259,7 +259,7 @@ main(void)
 
     /*
      * Disable access to any memory with "pkey" set,
-     * even though there is none right now
+     * even though there is none right now.
      */
     status = pkey_set(pkey, PKEY_DISABLE_ACCESS, 0);
     if (status)
@@ -278,7 +278,7 @@ main(void)
     printf("about to read buffer again...\en");
 
     /*
-     * This will crash, because we have disallowed access
+     * This will crash, because we have disallowed access.
      */
     printf("buffer contains: %d\en", *buffer);
 
index 844f862953c24dafadc4758d350de4e458cb58a1..d2a271a3bbe688482486e60fb97f23655b5ee1c2 100644 (file)
@@ -1827,30 +1827,30 @@ main (void)
     suseconds_t us;
     intmax_t    tmp;
 
-    /* Scan the number from the string into the temporary variable */
+    /* Scan the number from the string into the temporary variable. */
 
     sscanf(str, "%jd", &tmp);
 
-    /* Check that the value is within the valid range of suseconds_t */
+    /* Check that the value is within the valid range of suseconds_t. */
 
     if (tmp < \-1 || tmp > 1000000) {
         fprintf(stderr, "Scanned value outside valid range!\en");
         exit(EXIT_FAILURE);
     }
 
-    /* Copy the value to the suseconds_t variable \(aqus\(aq */
+    /* Copy the value to the suseconds_t variable \(aqus\(aq. */
 
     us = tmp;
 
     /* Even though suseconds_t can hold the value \-1, this isn\(aqt
-       a sensible number of microseconds */
+       a sensible number of microseconds. */
 
     if (us < 0) {
         fprintf(stderr, "Scanned value shouldn\(aqt be negative!\en");
         exit(EXIT_FAILURE);
     }
 
-    /* Print the value */
+    /* Print the value. */
 
     printf("There are %jd microseconds in half a second.\en",
             (intmax_t) us);
index 40edeb90d7e443b06d0c19aa6255a53f44e1ceba..c3372e28fb0f42bc36c3ecca1445eb7767f93fe0 100644 (file)
@@ -978,7 +978,7 @@ main(int argc, char *argv[])
     int result;
     char buffer[BUFFER_SIZE];
 
-    /* Create local socket */
+    /* Create local socket. */
 
     connection_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);
     if (connection_socket == \-1) {
@@ -994,7 +994,7 @@ main(int argc, char *argv[])
 
     memset(&name, 0, sizeof(name));
 
-    /* Bind socket to socket name */
+    /* Bind socket to socket name. */
 
     name.sun_family = AF_UNIX;
     strncpy(name.sun_path, SOCKET_NAME, sizeof(name.sun_path) \- 1);
@@ -1018,11 +1018,11 @@ main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    /* This is the main loop for handling connections */
+    /* This is the main loop for handling connections. */
 
     for (;;) {
 
-        /* Wait for incoming connection */
+        /* Wait for incoming connection. */
 
         data_socket = accept(connection_socket, NULL, NULL);
         if (data_socket == \-1) {
@@ -1033,7 +1033,7 @@ main(int argc, char *argv[])
         result = 0;
         for (;;) {
 
-            /* Wait for next data packet */
+            /* Wait for next data packet. */
 
             ret = read(data_socket, buffer, sizeof(buffer));
             if (ret == \-1) {
@@ -1041,11 +1041,11 @@ main(int argc, char *argv[])
                 exit(EXIT_FAILURE);
             }
 
-            /* Ensure buffer is 0\-terminated */
+            /* Ensure buffer is 0\-terminated. */
 
             buffer[sizeof(buffer) \- 1] = 0;
 
-            /* Handle commands */
+            /* Handle commands. */
 
             if (!strncmp(buffer, "DOWN", sizeof(buffer))) {
                 down_flag = 1;
@@ -1056,12 +1056,12 @@ main(int argc, char *argv[])
                 break;
             }
 
-            /* Add received summand */
+            /* Add received summand. */
 
             result += atoi(buffer);
         }
 
-        /* Send result */
+        /* Send result. */
 
         sprintf(buffer, "%d", result);
         ret = write(data_socket, buffer, sizeof(buffer));
@@ -1070,11 +1070,11 @@ main(int argc, char *argv[])
             exit(EXIT_FAILURE);
         }
 
-        /* Close socket */
+        /* Close socket. */
 
         close(data_socket);
 
-        /* Quit on DOWN command */
+        /* Quit on DOWN command. */
 
         if (down_flag) {
             break;
@@ -1083,7 +1083,7 @@ main(int argc, char *argv[])
 
     close(connection_socket);
 
-    /* Unlink the socket */
+    /* Unlink the socket. */
 
     unlink(SOCKET_NAME);
 
@@ -1111,7 +1111,7 @@ main(int argc, char *argv[])
     int data_socket;
     char buffer[BUFFER_SIZE];
 
-    /* Create local socket */
+    /* Create local socket. */
 
     data_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0);
     if (data_socket == \-1) {
@@ -1127,7 +1127,7 @@ main(int argc, char *argv[])
 
     memset(&addr, 0, sizeof(addr));
 
-    /* Connect socket to socket address */
+    /* Connect socket to socket address. */
 
     addr.sun_family = AF_UNIX;
     strncpy(addr.sun_path, SOCKET_NAME, sizeof(addr.sun_path) \- 1);
@@ -1139,7 +1139,7 @@ main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    /* Send arguments */
+    /* Send arguments. */
 
     for (int i = 1; i < argc; ++i) {
         ret = write(data_socket, argv[i], strlen(argv[i]) + 1);
@@ -1149,7 +1149,7 @@ main(int argc, char *argv[])
         }
     }
 
-    /* Request result */
+    /* Request result. */
 
     strcpy(buffer, "END");
     ret = write(data_socket, buffer, strlen(buffer) + 1);
@@ -1158,7 +1158,7 @@ main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    /* Receive result */
+    /* Receive result. */
 
     ret = read(data_socket, buffer, sizeof(buffer));
     if (ret == \-1) {
@@ -1166,13 +1166,13 @@ main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    /* Ensure buffer is 0\-terminated */
+    /* Ensure buffer is 0\-terminated. */
 
     buffer[sizeof(buffer) \- 1] = 0;
 
     printf("Result = %s\en", buffer);
 
-    /* Close socket */
+    /* Close socket. */
 
     close(data_socket);