Lines Matching refs:chk_error

78 #define chk_error(ret) __chk_error(__FILE__, __LINE__, (ret))
106 chk_error(mkdir(TESTPATH, 0755));
108 chk_error(chdir(TESTPATH));
112 fd = chk_error(open("file1", O_WRONLY | O_TRUNC | O_CREAT, 0644));
115 len = chk_error(write(fd, buf, FILE_BUF_SIZE / 2));
122 len = chk_error(writev(fd, vecs, 2));
125 chk_error(close(fd));
127 chk_error(rename("file1", "file2"));
129 fd = chk_error(open("file2", O_RDONLY));
131 len = chk_error(read(fd, buf2, FILE_BUF_SIZE));
138 ret = chk_error(lseek(fd, FOFFSET, SEEK_SET));
145 len = chk_error(readv(fd, vecs, 2));
151 chk_error(close(fd));
154 chk_error(access("file2", R_OK));
158 chk_error(chmod("file2", 0600));
161 chk_error(truncate("file2", 100));
162 chk_error(utime("file2", &tbuf));
163 chk_error(stat("file2", &st));
174 chk_error(stat(TESTPATH, &st));
179 fd = chk_error(open("file2", O_RDWR));
180 chk_error(ftruncate(fd, 50));
181 chk_error(fstat(fd, &st));
182 chk_error(close(fd));
190 chk_error(symlink("file2", "file3"));
191 chk_error(lstat("file3", &st));
215 chk_error(unlink("file3"));
216 chk_error(unlink("file2"));
217 chk_error(chdir(cur_dir));
218 chk_error(rmdir(TESTPATH));
225 pid = chk_error(fork());
230 chk_error(waitpid(pid, &status, 0));
242 chk_error(gettimeofday(&tv, NULL));
246 chk_error(nanosleep(&ts, &rem));
249 chk_error(gettimeofday(&tv2, NULL));
254 chk_error(getrusage(RUSAGE_SELF, &rusg1));
256 chk_error(getrusage(RUSAGE_SELF, &rusg2));
295 fd = chk_error(socket(PF_INET, SOCK_STREAM, 0));
298 chk_error(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)));
303 chk_error(bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)));
304 chk_error(listen(fd, 0));
315 fd = chk_error(socket(PF_INET, SOCK_STREAM, 0));
319 chk_error(connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)));
336 chk_error(getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &val, &len));
340 pid = chk_error(fork());
348 fd = chk_error(accept(server_fd, (struct sockaddr *)&sockaddr, &len));
350 ret = chk_error(recv(fd, buf, sizeof(buf), 0));
355 chk_error(close(fd));
356 chk_error(close(server_fd));
368 chk_error(pipe(fds));
369 chk_error(fcntl(fds[0], F_SETFL, O_NONBLOCK));
370 chk_error(fcntl(fds[1], F_SETFL, O_NONBLOCK));
383 ret = chk_error(select(fd_max + 1, &rfds, &wfds, NULL, NULL));
386 chk_error(read(fds[0], &ch, 1));
393 chk_error(write(fds[0], &ch, 1));
398 chk_error(close(fds[0]));
399 chk_error(close(fds[1]));
431 pid1 = chk_error(clone(thread1_func, stack1 + STACK_SIZE,
435 pid2 = chk_error(clone(thread2_func, stack2 + STACK_SIZE,
476 chk_error(sigaction(SIGALRM, &act, NULL));
482 chk_error(setitimer(ITIMER_REAL, &it, NULL));
483 chk_error(getitimer(ITIMER_REAL, &oit));
497 chk_error(setitimer(ITIMER_REAL, &it, &oit));
506 chk_error(sigaction(SIGSEGV, &act, NULL));
514 chk_error(sigaction(SIGSEGV, &act, NULL));
524 shmid = chk_error(shmget(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0777));
531 chk_error(shmctl(shmid, IPC_RMID, 0));
532 chk_error(shmdt(ptr));