diff options
Diffstat (limited to 'man7')
| -rw-r--r-- | man7/aio.7 | 14 | ||||
| -rw-r--r-- | man7/epoll.7 | 2 | ||||
| -rw-r--r-- | man7/pkeys.7 | 8 | ||||
| -rw-r--r-- | man7/system_data_types.7 | 10 | ||||
| -rw-r--r-- | man7/unix.7 | 38 |
5 files changed, 36 insertions, 36 deletions
diff --git a/man7/aio.7 b/man7/aio.7 index 9b2c44c48f..d87c4b8785 100644 --- a/man7/aio.7 +++ b/man7/aio.7 @@ -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++) { diff --git a/man7/epoll.7 b/man7/epoll.7 index 6c61f9e159..3e823376c0 100644 --- a/man7/epoll.7 +++ b/man7/epoll.7 @@ -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) { diff --git a/man7/pkeys.7 b/man7/pkeys.7 index d748017764..5f0cd5d3a6 100644 --- a/man7/pkeys.7 +++ b/man7/pkeys.7 @@ -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); diff --git a/man7/system_data_types.7 b/man7/system_data_types.7 index 844f862953..d2a271a3bb 100644 --- a/man7/system_data_types.7 +++ b/man7/system_data_types.7 @@ -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); diff --git a/man7/unix.7 b/man7/unix.7 index 40edeb90d7..c3372e28fb 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -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); |
