aboutsummaryrefslogtreecommitdiffstats
path: root/man7
diff options
context:
space:
mode:
Diffstat (limited to 'man7')
-rw-r--r--man7/fanotify.750
-rw-r--r--man7/inotify.724
-rw-r--r--man7/user_namespaces.716
3 files changed, 45 insertions, 45 deletions
diff --git a/man7/fanotify.7 b/man7/fanotify.7
index 5804a1f30d..c766e9b93d 100644
--- a/man7/fanotify.7
+++ b/man7/fanotify.7
@@ -800,7 +800,7 @@ Listening for events stopped.
#include <sys/fanotify.h>
#include <unistd.h>
-/* Read all available fanotify events from the file descriptor \(aqfd\(aq */
+/* Read all available fanotify events from the file descriptor \(aqfd\(aq. */
static void
handle_events(int fd)
@@ -813,11 +813,11 @@ handle_events(int fd)
char procfd_path[PATH_MAX];
struct fanotify_response response;
- /* Loop while events can be read from fanotify file descriptor */
+ /* Loop while events can be read from fanotify file descriptor. */
for (;;) {
- /* Read some events */
+ /* Read some events. */
len = read(fd, buf, sizeof(buf));
if (len == \-1 && errno != EAGAIN) {
@@ -825,20 +825,20 @@ handle_events(int fd)
exit(EXIT_FAILURE);
}
- /* Check if end of available data reached */
+ /* Check if end of available data reached. */
if (len <= 0)
break;
- /* Point to the first event in the buffer */
+ /* Point to the first event in the buffer. */
metadata = buf;
- /* Loop over all events in the buffer */
+ /* Loop over all events in the buffer. */
while (FAN_EVENT_OK(metadata, len)) {
- /* Check that run\-time and compile\-time structures match */
+ /* Check that run\-time and compile\-time structures match. */
if (metadata\->vers != FANOTIFY_METADATA_VERSION) {
fprintf(stderr,
@@ -852,24 +852,24 @@ handle_events(int fd)
if (metadata\->fd >= 0) {
- /* Handle open permission event */
+ /* Handle open permission event. */
if (metadata\->mask & FAN_OPEN_PERM) {
printf("FAN_OPEN_PERM: ");
- /* Allow file to be opened */
+ /* Allow file to be opened. */
response.fd = metadata\->fd;
response.response = FAN_ALLOW;
write(fd, &response, sizeof(response));
}
- /* Handle closing of writable file event */
+ /* Handle closing of writable file event. */
if (metadata\->mask & FAN_CLOSE_WRITE)
printf("FAN_CLOSE_WRITE: ");
- /* Retrieve and print pathname of the accessed file */
+ /* Retrieve and print pathname of the accessed file. */
snprintf(procfd_path, sizeof(procfd_path),
"/proc/self/fd/%d", metadata\->fd);
@@ -883,12 +883,12 @@ handle_events(int fd)
path[path_len] = \(aq\e0\(aq;
printf("File %s\en", path);
- /* Close the file descriptor of the event */
+ /* Close the file descriptor of the event. */
close(metadata\->fd);
}
- /* Advance to next event */
+ /* Advance to next event. */
metadata = FAN_EVENT_NEXT(metadata, len);
}
@@ -903,7 +903,7 @@ main(int argc, char *argv[])
nfds_t nfds;
struct pollfd fds[2];
- /* Check mount point is supplied */
+ /* Check mount point is supplied. */
if (argc != 2) {
fprintf(stderr, "Usage: %s MOUNT\en", argv[0]);
@@ -912,7 +912,7 @@ main(int argc, char *argv[])
printf("Press enter key to terminate.\en");
- /* Create the file descriptor for accessing the fanotify API */
+ /* Create the file descriptor for accessing the fanotify API. */
fd = fanotify_init(FAN_CLOEXEC | FAN_CLASS_CONTENT | FAN_NONBLOCK,
O_RDONLY | O_LARGEFILE);
@@ -924,7 +924,7 @@ main(int argc, char *argv[])
/* Mark the mount for:
\- permission events before opening files
\- notification events after closing a write\-enabled
- file descriptor */
+ file descriptor. */
if (fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT,
FAN_OPEN_PERM | FAN_CLOSE_WRITE, AT_FDCWD,
@@ -933,7 +933,7 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- /* Prepare for polling */
+ /* Prepare for polling. */
nfds = 2;
@@ -947,7 +947,7 @@ main(int argc, char *argv[])
fds[1].fd = fd;
fds[1].events = POLLIN;
- /* This is the loop to wait for incoming events */
+ /* This is the loop to wait for incoming events. */
printf("Listening for events.\en");
@@ -964,7 +964,7 @@ main(int argc, char *argv[])
if (poll_num > 0) {
if (fds[0].revents & POLLIN) {
- /* Console input is available: empty stdin and quit */
+ /* Console input is available: empty stdin and quit. */
while (read(STDIN_FILENO, &buf, 1) > 0 && buf != \(aq\en\(aq)
continue;
@@ -973,7 +973,7 @@ main(int argc, char *argv[])
if (fds[1].revents & POLLIN) {
- /* Fanotify events are available */
+ /* Fanotify events are available. */
handle_events(fd);
}
@@ -1111,7 +1111,7 @@ main(int argc, char **argv)
printf("Listening for events.\en");
- /* Read events from the event queue into a buffer */
+ /* Read events from the event queue into a buffer. */
len = read(fd, events_buf, sizeof(events_buf));
if (len == \-1 && errno != EAGAIN) {
@@ -1119,7 +1119,7 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
- /* Process all events within the buffer */
+ /* Process all events within the buffer. */
for (metadata = (struct fanotify_event_metadata *) events_buf;
FAN_EVENT_OK(metadata, len);
@@ -1127,7 +1127,7 @@ main(int argc, char **argv)
fid = (struct fanotify_event_info_fid *) (metadata + 1);
file_handle = (struct file_handle *) fid\->handle;
- /* Ensure that the event info is of the correct type */
+ /* Ensure that the event info is of the correct type. */
if (fid\->hdr.info_type == FAN_EVENT_INFO_TYPE_FID ||
fid\->hdr.info_type == FAN_EVENT_INFO_TYPE_DFID) {
@@ -1170,7 +1170,7 @@ main(int argc, char **argv)
snprintf(procfd_path, sizeof(procfd_path), "/proc/self/fd/%d",
event_fd);
- /* Retrieve and print the path of the modified dentry */
+ /* Retrieve and print the path of the modified dentry. */
path_len = readlink(procfd_path, path, sizeof(path) \- 1);
if (path_len == \-1) {
@@ -1197,7 +1197,7 @@ main(int argc, char **argv)
}
}
- /* Close associated file descriptor for this event */
+ /* Close associated file descriptor for this event. */
close(event_fd);
}
diff --git a/man7/inotify.7 b/man7/inotify.7
index e86bdee67b..b9e7842911 100644
--- a/man7/inotify.7
+++ b/man7/inotify.7
@@ -963,14 +963,14 @@ handle_events(int fd, int *wd, int argc, char* argv[])
if (len <= 0)
break;
- /* Loop over all events in the buffer */
+ /* Loop over all events in the buffer. */
for (char *ptr = buf; ptr < buf + len;
ptr += sizeof(struct inotify_event) + event\->len) {
event = (const struct inotify_event *) ptr;
- /* Print event type */
+ /* Print event type. */
if (event\->mask & IN_OPEN)
printf("IN_OPEN: ");
@@ -979,7 +979,7 @@ handle_events(int fd, int *wd, int argc, char* argv[])
if (event\->mask & IN_CLOSE_WRITE)
printf("IN_CLOSE_WRITE: ");
- /* Print the name of the watched directory */
+ /* Print the name of the watched directory. */
for (int i = 1; i < argc; ++i) {
if (wd[i] == event\->wd) {
@@ -988,12 +988,12 @@ handle_events(int fd, int *wd, int argc, char* argv[])
}
}
- /* Print the name of the file */
+ /* Print the name of the file. */
if (event\->len)
printf("%s", event\->name);
- /* Print type of filesystem object */
+ /* Print type of filesystem object. */
if (event\->mask & IN_ISDIR)
printf(" [directory]\en");
@@ -1019,7 +1019,7 @@ main(int argc, char* argv[])
printf("Press ENTER key to terminate.\en");
- /* Create the file descriptor for accessing the inotify API */
+ /* Create the file descriptor for accessing the inotify API. */
fd = inotify_init1(IN_NONBLOCK);
if (fd == \-1) {
@@ -1027,7 +1027,7 @@ main(int argc, char* argv[])
exit(EXIT_FAILURE);
}
- /* Allocate memory for watch descriptors */
+ /* Allocate memory for watch descriptors. */
wd = calloc(argc, sizeof(int));
if (wd == NULL) {
@@ -1049,7 +1049,7 @@ main(int argc, char* argv[])
}
}
- /* Prepare for polling */
+ /* Prepare for polling. */
nfds = 2;
@@ -1063,7 +1063,7 @@ main(int argc, char* argv[])
fds[1].fd = fd;
fds[1].events = POLLIN;
- /* Wait for events and/or terminal input */
+ /* Wait for events and/or terminal input. */
printf("Listening for events.\en");
while (1) {
@@ -1079,7 +1079,7 @@ main(int argc, char* argv[])
if (fds[0].revents & POLLIN) {
- /* Console input is available. Empty stdin and quit */
+ /* Console input is available. Empty stdin and quit. */
while (read(STDIN_FILENO, &buf, 1) > 0 && buf != \(aq\en\(aq)
continue;
@@ -1088,7 +1088,7 @@ main(int argc, char* argv[])
if (fds[1].revents & POLLIN) {
- /* Inotify events are available */
+ /* Inotify events are available. */
handle_events(fd, wd, argc, argv);
}
@@ -1097,7 +1097,7 @@ main(int argc, char* argv[])
printf("Listening for events stopped.\en");
- /* Close inotify file descriptor */
+ /* Close inotify file descriptor. */
close(fd);
diff --git a/man7/user_namespaces.7 b/man7/user_namespaces.7
index b417afa807..c234a8be76 100644
--- a/man7/user_namespaces.7
+++ b/man7/user_namespaces.7
@@ -1087,7 +1087,7 @@ CapEff: 0000001fffffffff
#include <errno.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)
@@ -1153,7 +1153,7 @@ update_map(char *mapping, char *map_file)
int fd;
size_t map_len; /* Length of \(aqmapping\(aq */
- /* Replace commas in mapping string with newlines */
+ /* Replace commas in mapping string with newlines. */
map_len = strlen(mapping);
for (int j = 0; j < map_len; j++)
@@ -1233,7 +1233,7 @@ childFunc(void *arg)
close(args\->pipe_fd[1]); /* Close our descriptor for the write
end of the pipe so that we see EOF
- when parent closes its descriptor */
+ when parent closes its descriptor. */
if (read(args\->pipe_fd[0], &ch, 1) != 0) {
fprintf(stderr,
"Failure in child: read from pipe returned != 0\en");
@@ -1242,7 +1242,7 @@ childFunc(void *arg)
close(args\->pipe_fd[0]);
- /* Execute a shell command */
+ /* Execute a shell command. */
printf("About to exec %s\en", args\->argv[0]);
execvp(args\->argv[0], args\->argv);
@@ -1314,20 +1314,20 @@ main(int argc, char *argv[])
if (pipe(args.pipe_fd) == \-1)
errExit("pipe");
- /* Create the child in new namespace(s) */
+ /* Create the child in new namespace(s). */
child_pid = clone(childFunc, child_stack + STACK_SIZE,
flags | SIGCHLD, &args);
if (child_pid == \-1)
errExit("clone");
- /* Parent falls through to here */
+ /* Parent falls through to here. */
if (verbose)
printf("%s: PID of child created by clone() is %jd\en",
argv[0], (intmax_t) child_pid);
- /* Update the UID and GID maps in the child */
+ /* Update the UID and GID maps in the child. */
if (uid_map != NULL || map_zero) {
snprintf(map_path, PATH_MAX, "/proc/%jd/uid_map",
@@ -1354,7 +1354,7 @@ main(int argc, char *argv[])
}
/* Close the write end of the pipe, to signal to the child that we
- have updated the UID and GID maps */
+ have updated the UID and GID maps. */
close(args.pipe_fd[1]);