/illumos-gate/usr/src/boot/sys/boot/common/ |
H A D | ls.c | 61 int fd; local 70 fd = -1; 106 fd = ls_getdir(&path); 107 if (fd == -1) { 115 while ((d = readdirfd(fd)) != NULL) { 142 if (fd != -1) 143 close(fd); 150 * Given (path) containing a vaguely reasonable path specification, return an fd 157 int fd; local 161 fd [all...] |
/illumos-gate/usr/src/lib/libc/port/sys/ |
H A D | epoll.c | 70 int fd; local 82 if ((fd = open("/dev/poll", O_RDWR)) == -1) 85 if (ioctl(fd, DP_EPOLLCOMPAT, 0) == -1) { 86 (void) close(fd); 90 return (fd); 96 int fd, oflags = O_RDWR; local 108 if ((fd = open("/dev/poll", oflags)) == -1) 111 if (ioctl(fd, DP_EPOLLCOMPAT, 0) == -1) { 112 (void) close(fd); 116 return (fd); 120 epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) argument [all...] |
H A D | utimesys.c | 36 futimens(int fd, const timespec_t times[2]) argument 38 return (syscall(SYS_utimesys, 0, fd, times)); 42 utimensat(int fd, const char *path, const timespec_t times[2], int flag) argument 44 return (syscall(SYS_utimesys, 1, fd, path, times, flag)); 94 futimesat(int fd, const char *path, const struct timeval times[2]) argument 114 return (futimens(fd, tsp)); 116 return (utimensat(fd, path, tsp, 0));
|
/illumos-gate/usr/src/cmd/iscsiadm/ |
H A D | sun_ima.c | 76 static int open_driver(int *fd); 168 int fd; local 177 if ((status = open_driver(&fd))) { 183 (void) close(fd); 195 if (ioctl(fd, ISCSI_DISCOVERY_ADDR_LIST_GET, ialp) != 0) { 196 (void) close(fd); 216 (void) close(fd); 226 if (ioctl(fd, ISCSI_DISCOVERY_ADDR_LIST_GET, ialp) != 0) { 229 (void) close(fd); 243 (void) close(fd); 288 int fd; local 365 int fd; local 451 int fd; local 537 int fd; local 594 int fd; local 664 int fd; local 715 int fd; local 778 int fd; local 815 int fd; local 947 int fd; local 980 int fd; local 1009 int fd; local 1041 int fd; local 1189 int fd; local 1590 int fd; local 1691 int fd; local 1761 int fd; local 1834 int fd; local 1922 int fd, status; local 1982 int fd; local 2060 int fd; local 2230 int fd; local 2330 int fd; local 2373 int fd; local 2423 int fd; local 2481 int fd; local 2660 int fd; local 2773 int fd, status; local 2808 int fd; local 2841 int fd; local 2994 int fd; local 3044 int fd; local 3084 int fd; local 3128 int fd; local 3162 int fd; local 3191 int fd; local 3224 int fd; local [all...] |
/illumos-gate/usr/src/cmd/ipf/tools/ |
H A D | ipfs.c | 113 int fd, olen, nlen, rw; local 128 fd = open(fname, O_RDWR); 129 if (fd == -1) { 134 for (pos = 0; read(fd, &ips, sizeof(ips)) == sizeof(ips); ) { 145 if (lseek(fd, pos, SEEK_SET) != pos) { 149 if (write(fd, &ips, sizeof(ips)) != sizeof(ips)) { 154 pos = lseek(fd, 0, SEEK_CUR); 156 close(fd); 168 int fd, olen, nlen, rw; local 185 fd 359 int fd = -1; local 786 int fd, devfd; local 837 int fd, devfd; local [all...] |
/illumos-gate/usr/src/lib/storage/libg_fc/common/ |
H A D | io.c | 89 g_scsi_persistent_reserve_in_cmd(int fd, uchar_t *buf_ptr, argument 96 if ((fd < 0) || (buf_ptr == NULL) || (buf_len < 0)) { 117 return (cmd(fd, &ucmd, USCSI_READ | USCSI_SILENT)); 125 g_scsi_send_diag_cmd(int fd, uchar_t *buf_ptr, int buf_len) argument 132 if ((fd < 0) || (buf_ptr == NULL) || (buf_len < 0)) { 147 if (err = cmd(fd, &ucmd, USCSI_WRITE)) { 162 rec_diag_cmd(int fd, uchar_t *buf_ptr, int buf_len, uchar_t page_code, argument 169 if ((fd < 0) || (buf_ptr == NULL) || (buf_len < 0)) { 186 return (cmd(fd, &ucmd, USCSI_READ)); 194 g_scsi_rec_diag_cmd(int fd, uchar_ argument 226 g_scsi_writebuffer_cmd(int fd, int off, uchar_t *buf_ptr, int buf_len, int sp, int bid) argument 263 g_scsi_readbuffer_cmd(int fd, uchar_t *buf_ptr, int buf_len, int code_off) argument 292 g_scsi_inquiry_cmd(int fd, uchar_t *buf_ptr, int buf_len) argument 335 g_scsi_log_sense_cmd(int fd, uchar_t *buf_ptr, int buf_len, uchar_t page_code) argument 370 g_scsi_mode_select_cmd(int fd, uchar_t *buf_ptr, int buf_len, uchar_t sp) argument 406 g_scsi_mode_sense_cmd(int fd, uchar_t *buf_ptr, int buf_len, uchar_t pc, uchar_t page_code) argument 456 g_scsi_read_capacity_cmd(int fd, uchar_t *buf_ptr, int buf_len) argument 481 g_scsi_read_capacity_1016_cmd(int fd, struct scsi_capacity_16 *cap_ptr, int buf_len) argument 525 scsi_read_capacity_16_cmd(int fd, struct scsi_capacity_16 *cap_ptr, int buf_len) argument 573 g_scsi_release_cmd(int fd) argument 596 g_scsi_reserve_cmd(int fd) argument 619 g_scsi_start_cmd(int fd) argument 645 g_scsi_stop_cmd(int fd, int immediate_flag) argument 670 g_scsi_tur(int fd) argument 696 g_scsi_reset(int fd) argument [all...] |
/illumos-gate/usr/src/cmd/lp/filter/postscript/postio/ |
H A D | parallel.c | 90 int is_a_parallel_bpp(int fd) argument 92 if (ioctl(fd, BPPIOC_TESTIO) == 0 || errno == EIO) 114 int bpp_state(int fd) argument 116 if (ioctl(fd, BPPIOC_TESTIO)) { 120 if (ioctl(fd, BPPIOC_GETERR, &bpp_stat) < 0) 152 get_ecpp_status(int fd) argument 158 if (ioctl(fd, ECPPIOC_GETPARMS, &transfer_parms) == -1) { 171 if (ioctl(fd, ECPPIOC_SETPARMS, &transfer_parms) == -1) { 184 int is_a_prnio(int fd) argument 189 if (ioctl(fd, PRNIOC_GET_IFCA 203 prnio_state(int fd) argument 313 wait_state(int fd, int get_state()) argument 337 parallel_comm(int fd, int get_state()) argument [all...] |
/illumos-gate/usr/src/cmd/ipdadm/ |
H A D | ipdadm.c | 108 int fd, rval; local 121 fd = ipd_open(NULL); 122 if (fd < 0) { 127 rval = ipd_status_read(fd, &hdl); 128 (void) ipd_close(fd); 146 int rval, fd; local 153 fd = ipd_open(NULL); 154 if (fd < 0) { 159 rval = ipd_status_read(fd, &hdl); 160 (void) ipd_close(fd); 228 int rval, fd; local 265 int fd, rval; local 301 int fd, rval; local 352 int rval, fd; local [all...] |
/illumos-gate/usr/src/cmd/lp/cmd/lpsched/ |
H A D | alerts.c | 152 int fd; local 155 if ((fd = open_locked(file, "a", MODE_READ)) < 0) 158 fdprintf(fd, text); 159 close(fd); 161 if ((fd = open_locked(file, "w", MODE_READ)) < 0) 163 fdprintf(fd, Pf_msg[0], NB(pr->printer->name), NB(pr->printer->name)); 165 fdprintf(fd, Pf_msg[2]); 168 fdprintf(fd, Pf_msg[1]); 170 fdprintf(fd, Pf_msg[3], rp->secure->req_id); 172 fdprintf(fd, Pf_ms 185 int fd, i; local 209 int fd, i; local [all...] |
H A D | ports.c | 83 int speed, fd; local 96 if ((fd = dial(call)) < 0) 97 return (EXEC_EXIT_NDIAL | (~EXEC_EXIT_NMASK & abs(fd))); 104 if (fd != 1) { 105 dup2(fd, 1); 106 Close(fd); 157 int open_mode, fd; local 215 while ((fd = open(device, open_mode, 0)) == -1) { 235 if (strcmp(device, "/dev/null") && Fcntl(fd, F_SETLKW, &lck) < 0) { 244 if (fd ! 323 push_module(int fd, char *device, char *module) argument [all...] |
/illumos-gate/usr/src/lib/pkcs11/pkcs11_softtoken/common/ |
H A D | softKeystoreUtil.c | 239 calculate_hashed_pin_offset(int fd) argument 243 if (lseek(fd, KS_HASHED_PIN_SALT_LEN_OFFSET, SEEK_SET) 248 if (readn_nointr(fd, (char *)&salt_length, 268 lock_file(int fd, boolean_t read_lock, boolean_t set_lock) argument 285 while ((r = fcntl(fd, F_SETLKW, &lock_info)) == -1) { 294 while ((r = fcntl(fd, F_SETLKW, &lock_info)) == -1) { 309 int fd, buf; local 358 fd = open_nointr(get_desc_file_path(ks_desc_file), 360 if (fd < 0) { 370 if (lock_file(fd, B_FALS 500 is_inode_same(int fd, char *fname, boolean_t *same) argument 523 acquire_file_lock(int *fd, char *fname, mode_t mode) argument 588 int fd; local 681 int fd; local 727 create_updated_keystore_version(int fd, char *tmp_fname) argument 865 get_hashed_pin(int fd, char **hashed_pin) argument 972 int fd; local 1002 soft_keystore_unlock_object(int fd) argument 1034 int fd, ret_val = 0; local 1088 int fd, ret_val = 0; local 1145 int fd, ret_val = -1; local 1434 int fd, tmp_ks_fd, version, ret_val = -1; local 1804 int fd; local 2028 int fd; local 2196 int fd, tmp_ks_fd, obj_fd; local 2473 int fd, ks_fd, tmp_fd, version; local 2707 int fd; local 2780 int fd, ret_val = -1; local 2853 int fd; local [all...] |
/illumos-gate/usr/src/lib/libresolv2/common/isc/ |
H A D | ev_connects.c | 57 static void listener(evContext ctx, void *uap, int fd, int evmask); 58 static void connector(evContext ctx, void *uap, int fd, int evmask); 63 evListen(evContext opaqueCtx, int fd, int maxconn, argument 72 OKFREE(mode = fcntl(fd, F_GETFL, NULL), new); /*%< side effect: validate fd. */ 75 * has not been done to this fd, or that if it has then the caller 83 OKFREE(ioctl(fd, FIONBIO, (char *)&on), new); 85 OKFREE(fcntl(fd, F_SETFL, mode | PORT_NONBLOCK), new); 89 OKFREE(listen(fd, maxconn), new); 90 if (evSelectFD(opaqueCtx, fd, EV_REA 112 evConnect(evContext opaqueCtx, int fd, const void *ra, int ralen, evConnFunc func, void *uap, evConnID *id) argument 280 listener(evContext opaqueCtx, void *uap, int fd, int evmask) argument 316 connector(evContext opaqueCtx, void *uap, int fd, int evmask) argument [all...] |
/illumos-gate/usr/src/cmd/cmd-inet/usr.lib/inetd/ |
H A D | tlx.c | 80 int fd; local 82 if ((fd = open("/dev/udp", O_RDONLY)) < 0) { 88 if (ioctl(fd, SIOCGLIFNUM, &lifn, sizeof (lifn)) < 0) { 92 (void) close(fd); 220 * Attempts to bind an address to the network fd 'fd'. If 'reqaddr' is non-NULL, 229 tlx_bind(int fd, const struct netbuf *reqaddr, struct netbuf *retaddr, int qlen) argument 247 if (t_bind(fd, &breq, retaddr != NULL ? &bret : NULL) < 0) 257 tlx_setsockopt(int fd, int level, int optname, const void *optval, argument 284 if ((t_optmgmt(fd, 311 int fd; local 385 get_new_conind(int fd) argument 449 int fd = tlx_info->pr_info.listen_fd; local 540 int fd; local 630 close_net_fd(instance_t *inst, int fd) argument 643 consume_wait_data(instance_t *inst, int fd) argument [all...] |
/illumos-gate/usr/src/cmd/cvcd/sparc/sun4u/starcat/ |
H A D | cvcd.c | 164 int fd; local 224 if ((fd = open(NODENAME, O_RDONLY)) > 0) { 225 if ((i = read(fd, utsname.nodename, SYS_NMLN)) <= 0) { 231 (void) close(fd); 272 pfds[i].fd = -1; 306 pfds[LISTEN_PFD].fd = cvcd_init_host_socket(tport, ah_auth_alg, 326 fd = accept(pfds[LISTEN_PFD].fd, NULL, NULL); 327 if ((fd == -1) && (errno != EWOULDBLOCK)) { 333 } while (fd 492 int fd; local 649 int fd; local [all...] |
/illumos-gate/usr/src/cmd/svc/configd/ |
H A D | maindoor.c | 60 int fd; local 112 fd = -1; 114 arg_size, &fd); 116 assert(fd == -1); 119 assert(fd != -1); 121 reply_desc.d_data.d_desc.d_descriptor = fd; 145 int fd; local 172 fd = open(doorpath, O_RDWR | O_CREAT | O_EXCL, 0644); 175 if (fd >= 0) 176 (void) close(fd); [all...] |
/illumos-gate/usr/src/lib/libast/common/comp/ |
H A D | fcntl.c | 52 _ast_fcntl(int fd, int op, ...) 66 op = dup2(fd, n); 71 op = fstat(fd, &st); 77 op = ioctl(fd, n == FD_CLOEXEC ? FIOCLEX : FIONCLEX, 0); 87 op = fcntl(fd, op, va_arg(ap, int));
|
/illumos-gate/usr/src/cmd/lp/lib/users/ |
H A D | loadpri.c | 83 int fd; local 85 if ((fd = open_locked(path, "r", 0)) < 0) { 107 if (!(p = fdgets(line, BUFSIZ, fd))) 132 if (!(user = next_user(fd, line, &p))) 138 if (!(user = next_user(fd, line, &p))) goto Error; 144 close(fd); 153 while ((user = next_user(fd, line, &p))); 163 close(fd); 197 char * next_user (int fd, char * buf, char ** pp ) argument 231 while (*pp = fdgets(buf, BUFSIZ, fd)); [all...] |
/illumos-gate/usr/src/lib/libsmbios/common/ |
H A D | smb_lib.c | 52 smb_fileopen(int fd, int version, int flags, int *errp) argument 59 if ((n = pread64(fd, ep, sizeof (*ep), 0)) != sizeof (*ep)) 67 if ((n = pread64(fd, ep, elen, 0)) != elen) 73 if ((n = pread64(fd, stbuf, ep->smbe_stlen, 90 smb_biosopen(int fd, int version, int flags, int *errp) argument 98 PROT_READ, MAP_SHARED, fd, (uint32_t)SMB_RANGE_START); 125 PROT_READ, MAP_SHARED, fd, ep->smbe_staddr & pgmask); 148 smbios_fdopen(int fd, int version, int flags, int *errp) argument 152 if (stat64(SMB_BIOS_DEVICE, &st1) == 0 && fstat64(fd, &st2) == 0 && 154 return (smb_biosopen(fd, versio 163 int fd; local 178 smbios_xwrite(smbios_hdl_t *shp, int fd, const void *buf, size_t buflen) argument 194 smbios_write(smbios_hdl_t *shp, int fd) argument [all...] |
/illumos-gate/usr/src/cmd/ttymon/ |
H A D | ulockf.c | 116 int fd; local 118 fd = open(name, O_RDONLY); 120 if (fd == -1) { 126 ret = read(fd, (char *) alpid, SIZEOFPID+1); /* +1 for '\n' */ 127 (void) close(fd); 300 register int fd; local 303 fd=creat(tempfile, (mode_t) 0444); 304 if(fd < 0){ 312 if (write(fd, pid, SIZEOFPID+1) != (SIZEOFPID+1)) { 320 (void) close(fd); [all...] |
/illumos-gate/usr/src/lib/libbc/libc/sys/common/ |
H A D | _stat.c | 67 fstat(int fd, struct stat *buf) argument 69 return (bc_fstat(fd, buf)); 73 bc_fstat(int fd, struct stat *buf) argument 84 if ((ret = _syscall(SYS_fstatat, fd, NULL, &nb, 0)) == -1) 88 if (fd_get(fd) != -1) { 99 int fd, ret; local 112 * fd = open_mnt("/etc/mnttab", "mtab", O_RDONLY); 113 * ret = fstat(fd, buf); 114 * close(fd); 121 fd [all...] |
H A D | getdents.c | 48 int getdents(fd, buf, bytes) 49 int fd; 53 return(bc_getdents(fd, buf, bytes)); 57 int bc_getdents(fd, buf, bytes) 58 int fd; 80 if ((ret = _syscall(SYS_getdents, fd, nbuf, nbytes)) == -1) { 113 (void)lseek(fd, last_off, SEEK_SET);
|
/illumos-gate/usr/src/cmd/rcap/rcapd/ |
H A D | rcapd_rfd.c | 155 int fd; local 158 while ((fd = open(name, oflag, mode)) == -1 && (errno == ENFILE || 167 if (fd != -1) { 173 (void) close(fd); 177 rfd->rfd_fd = fd; 191 return (fd); 198 rfd_close(int fd) argument 210 if (rfd->rfd_fd == fd) { 233 return (close(fd)); 244 int fd local [all...] |
/illumos-gate/usr/src/lib/libsmbfs/smb/ |
H A D | connect.c | 81 smb_setopt_int(int fd, int level, int name, int val) argument 104 if (t_optmgmt(fd, &oreq, &ores) < 0) { 120 smb_setopts(int fd) argument 133 err = smb_setopt_int(fd, SOL_SOCKET, SO_SNDBUF, smb_tcpsndbuf); 138 err = smb_setopt_int(fd, SOL_SOCKET, SO_RCVBUF, smb_tcprcvbuf); 143 err = smb_setopt_int(fd, SOL_SOCKET, SO_KEEPALIVE, 1); 148 err = smb_setopt_int(fd, IPPROTO_TCP, TCP_NODELAY, 1); 154 err = smb_setopt_int(fd, IPPROTO_TCP, 171 int fd, err; local 184 fd 232 int fd, err; local [all...] |
/illumos-gate/usr/src/lib/libnsl/nsl/ |
H A D | t_unbind.c | 49 _tx_unbind(int fd, int api_semantics) argument 56 if ((tiptr = _t_checkfd(fd, 0, api_semantics)) == NULL) 91 retval = _tx_unbind_locked(fd, tiptr, &ctlbuf); 105 _tx_unbind_locked(int fd, struct _ti_user *tiptr, struct strbuf *ctlbufp) argument 110 if (_t_is_event(fd, tiptr) < 0) 117 if (_t_do_ioctl(fd, (char *)unbind_reqp, 122 if (ioctl(fd, I_FLUSH, FLUSHRW) < 0) {
|
/illumos-gate/usr/src/lib/libnsl/yp/ |
H A D | yp_rsvd.c | 47 int fd; local 62 if ((fd = t_open(nconf->nc_device, O_RDWR, NULL)) == -1) { 68 (void) netdir_options(nconf, ND_SET_RESERVEDPORT, fd, NULL); 71 if ((tbind = (struct t_bind *)t_alloc(fd, T_BIND, T_ADDR)) == NULL) { 79 (void) t_close(fd); 85 if ((clnt = clnt_tli_create(fd, nconf, svcaddr, 87 (void) t_close(fd);
|