...ssize_t len, slen; if (argc != 2) { fprintf(stderr, "Usage: %s <file>\n", argv[0]); exit(EXIT_FAILURE); } fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644); if (fd == -1) {…...flen, keylen, vallen; if (argc != 2) { fprintf(stderr, "Usage: %s path\n", argv[0]); exit(EXIT_FAILURE); } /* * Determine the length of the buffer needed. */ buflen = listxattr(…...flen, keylen, vallen; if (argc != 2) { fprintf(stderr, "Usage: %s path\n", argv[0]); exit(EXIT_FAILURE); } /* * Determine the length of the buffer needed. */ buflen = listxattr(…...flen, keylen, vallen; if (argc != 2) { fprintf(stderr, "Usage: %s path\n", argv[0]); exit(EXIT_FAILURE); } /* * Determine the length of the buffer needed. */ buflen = listxattr(…...file_handle *fhp; if (argc != 2) { fprintf(stderr, "Usage: %s pathname\n", argv[0]); exit(EXIT_FAILURE); } pathname = argv[1]; /* Allocate file_handle structure. */ fhsize = siz…...file_handle *fhp; if (argc != 2) { fprintf(stderr, "Usage: %s pathname\n", argv[0]); exit(EXIT_FAILURE); } pathname = argv[1]; /* Allocate file_handle structure. */ fhsize = siz…...reate1(0); struct epoll_params params; if (epollfd == -1) { perror("epoll_create1"); exit(EXIT_FAILURE); } memset(¶ms, 0, sizeof(struct epoll_params)); params.busy_poll_usec…...at; if (argc != 3) { fprintf(stderr, "Usage: %s <source> <destination>\n", argv[0]); exit(EXIT_FAILURE); } fd_in = open(argv[1], O_RDONLY); if (fd_in == -1) { perror("open (argv…...tial mount namespace. */ if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL) == -1) err(EXIT_FAILURE, "mount-MS_PRIVATE"); /* Ensure that 'new_root' is a mount point. */ if (m…...buf; pid_t cpid; if (argc != 2) { fprintf(stderr, "Usage: %s <string>\n", argv[0]); exit(EXIT_FAILURE); } if (pipe(pipefd) == -1) { perror("pipe"); exit(EXIT_FAILURE); } cpid = …...buf; pid_t cpid; if (argc != 2) { fprintf(stderr, "Usage: %s <string>\n", argv[0]); exit(EXIT_FAILURE); } if (pipe(pipefd) == -1) { perror("pipe"); exit(EXIT_FAILURE); } cpid = …...struct stat sb; if (argc != 2) { fprintf(stderr, "Usage: %s <pathname>\n", argv[0]); exit(EXIT_FAILURE); } if (lstat(argv[1], &sb) == -1) { perror("lstat"); exit(EXIT_FAILURE); …...struct stat sb; if (argc != 2) { fprintf(stderr, "Usage: %s <pathname>\n", argv[0]); exit(EXIT_FAILURE); } if (lstat(argv[1], &sb) == -1) { perror("lstat"); exit(EXIT_FAILURE); …operate on Secure Computing state of the process NAME seccomp - operate on Secure Computing state of the process LIBRARY Standard C library ( libc , -lc ) SYNOPSIS #include <linux/…...dirent *dp; dirp = opendir("/proc/self/fd"); if (dirp == NULL) { perror("opendir"); exit(EXIT_FAILURE); } for (;;) { dp = readdir(dirp); if (dp == NULL) break; if (dp->d_type ==…...nfo_t info; if (argc != 3) { fprintf(stderr, "Usage: %s <pid> <signal>\n", argv[0]); exit(EXIT_FAILURE); } sig = atoi(argv[2]); /* Obtain a PID file descriptor by opening the /p…...(stderr, "\t\tW - F_SEAL_FUTURE_WRITE\n"); fprintf(stderr, "\t\tS - F_SEAL_SEAL\n"); exit(EXIT_FAILURE); } name = argv[1]; len = atoi(argv[2]); seals_arg = argv[3]; /* Create an…...dr; sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd == -1) { perror("socket()"); exit(EXIT_FAILURE); } addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_LOOPBAC…...ontext = syscall(SYS_spu_create, "/spu/example-context", 0, 0755); if (context == -1) err(EXIT_FAILURE, "spu_create"); /* * Write a 'stop 0x1234' instruction to the SPU's * loca…...gv[]) { int wstatus; pid_t cpid, w; cpid = fork(); if (cpid == -1) { perror("fork"); exit(EXIT_FAILURE); } if (cpid == 0) { /* Code executed by child */ printf("Child PID is %jd…