Lines Matching refs:err
42 int err; in os_stat_fd() local
44 CATCH_EINTR(err = fstat64(fd, &sbuf)); in os_stat_fd()
45 if (err < 0) in os_stat_fd()
50 return err; in os_stat_fd()
56 int err; in os_stat_file() local
58 CATCH_EINTR(err = stat64(file_name, &sbuf)); in os_stat_file()
59 if (err < 0) in os_stat_file()
64 return err; in os_stat_file()
69 int amode, err; in os_access() local
76 err = access(file, amode); in os_access()
77 if (err < 0) in os_access()
86 int err; in os_ioctl_generic() local
88 err = ioctl(fd, cmd, arg); in os_ioctl_generic()
89 if (err < 0) in os_ioctl_generic()
92 return err; in os_ioctl_generic()
121 int err; in os_mode_fd() local
123 CATCH_EINTR(err = fchmod(fd, mode)); in os_mode_fd()
124 if (err < 0) in os_mode_fd()
133 int err; in os_file_type() local
135 err = os_stat_file(file, &buf); in os_file_type()
136 if (err < 0) in os_file_type()
137 return err; in os_file_type()
156 int err; in os_file_mode() local
160 err = access(file, W_OK); in os_file_mode()
161 if (err && (errno != EACCES)) in os_file_mode()
163 else if (!err) in os_file_mode()
166 err = access(file, R_OK); in os_file_mode()
167 if (err && (errno != EACCES)) in os_file_mode()
169 else if (!err) in os_file_mode()
172 return err; in os_file_mode()
177 int fd, err, f = 0; in os_open_file() local
203 err = -errno; in os_open_file()
205 return err; in os_open_file()
214 int fd, err; in os_connect_socket() local
221 err = -errno; in os_connect_socket()
225 err = connect(fd, (struct sockaddr *) &sock, sizeof(sock)); in os_connect_socket()
226 if (err) { in os_connect_socket()
227 err = -errno; in os_connect_socket()
236 return err; in os_connect_socket()
309 int err; in os_file_size() local
311 err = os_stat_file(file, &buf); in os_file_size()
312 if (err < 0) { in os_file_size()
314 -err); in os_file_size()
315 return err; in os_file_size()
324 err = -errno; in os_file_size()
327 return err; in os_file_size()
330 err = -errno; in os_file_size()
334 return err; in os_file_size()
347 int err; in os_file_modtime() local
349 err = os_stat_file(file, &buf); in os_file_modtime()
350 if (err < 0) { in os_file_modtime()
352 -err); in os_file_modtime()
353 return err; in os_file_modtime()
362 int err; in os_set_exec_close() local
364 CATCH_EINTR(err = fcntl(fd, F_SETFD, FD_CLOEXEC)); in os_set_exec_close()
366 if (err < 0) in os_set_exec_close()
368 return err; in os_set_exec_close()
373 int err, type = stream ? SOCK_STREAM : SOCK_DGRAM; in os_pipe() local
375 err = socketpair(AF_UNIX, type, 0, fds); in os_pipe()
376 if (err < 0) in os_pipe()
382 err = os_set_exec_close(fds[0]); in os_pipe()
383 if (err < 0) in os_pipe()
386 err = os_set_exec_close(fds[1]); in os_pipe()
387 if (err < 0) in os_pipe()
394 -err); in os_pipe()
397 return err; in os_pipe()
402 int err, flags; in os_set_fd_async() local
410 err = -errno; in os_set_fd_async()
413 return err; in os_set_fd_async()
418 err = -errno; in os_set_fd_async()
421 return err; in os_set_fd_async()
484 int what, err; in os_shutdown_socket() local
495 err = shutdown(fd, what); in os_shutdown_socket()
496 if (err < 0) in os_shutdown_socket()
544 int sock, err; in os_create_unix_socket() local
551 err = os_set_exec_close(sock); in os_create_unix_socket()
552 if (err < 0) in os_create_unix_socket()
554 "close_on_exec failed, err = %d", -err); in os_create_unix_socket()
561 err = bind(sock, (struct sockaddr *) &addr, sizeof(addr)); in os_create_unix_socket()
562 if (err < 0) in os_create_unix_socket()
580 int err, save; in os_lock_file() local
582 err = fcntl(fd, F_SETLK, &lock); in os_lock_file()
583 if (!err) in os_lock_file()
587 err = fcntl(fd, F_GETLK, &lock); in os_lock_file()
588 if (err) { in os_lock_file()
589 err = -errno; in os_lock_file()
595 err = save; in os_lock_file()
597 return err; in os_lock_file()
652 int err; in os_sendmsg_fds() local
661 err = sendmsg(fd, &msg, 0); in os_sendmsg_fds()
663 if (err < 0) in os_sendmsg_fds()
665 return err; in os_sendmsg_fds()