Home
last modified time | relevance | path

Searched refs:iop (Results 1 – 25 of 121) sorted by relevance

12345

/illumos-gate/usr/src/lib/libc/inc/
H A Dstdiom.h79 #define GET_NO_MODE(iop) (!((iop)->_flag & \ argument
89 #define GET_IONOLOCK(iop) ((iop)->__ionolock) argument
100 #define GET_SEEKABLE(iop) ((iop)->__seekable) argument
103 #define STDIOP(iop) ((iop) >= &_iob[0] && (iop) < &_iob[_NFILE]) argument
106 #define IOPIND(iop) ((iop) - &_iob[0]) argument
137 #define _bufend(iop) _realbufend(iop) argument
162 #define _realbufend(iop) ((iop)->_end) argument
194 #define SET_FILE(iop, fd) (iop)->_magic = (fd); (iop)->__extendedfd = 0 argument
255 (iop->_ptr == iop->_base && iop->_cnt == 0 && \
260 #define IOB_LCK(iop) (&((iop)->_lock)) argument
[all …]
/illumos-gate/usr/src/lib/libc/port/stdio/
H A Dflush.c531 iop->_cnt = 0; in _bufsync()
580 if (iop) { in fflush()
593 FPDECL(iop); in _fflush_l_iops()
676 (void) _xseek64(iop, -iop->_cnt, SEEK_CUR); in _fflush_u()
677 iop->_cnt = 0; in _fflush_u()
679 iop->_ptr = iop->_base; in _fflush_u()
685 if (iop->_base != NULL && iop->_ptr > iop->_base) { in _fflush_u()
721 iop->_cnt = 0; in fclose()
738 FPDECL(iop); in fcloseall()
790 if (iop == NULL || iop->_flag == 0) in close_fd()
[all …]
H A Dfwrite.c52 FLOCKFILE(lk, iop); in fwrite()
69 if (_WRTCHK(iop)) in _fwrite_unlocked()
84 iop->_cnt = iop->_base - iop->_ptr; in _fwrite_unlocked()
101 if (iop->_base != iop->_ptr) { in _fwrite_unlocked()
106 bytes = iop->_ptr - iop->_base; in _fwrite_unlocked()
120 iop->_cnt = 0; in _fwrite_unlocked()
121 iop->_ptr = iop->_base; in _fwrite_unlocked()
144 iop->_cnt); in _fwrite_unlocked()
146 iop->_ptr += iop->_cnt; in _fwrite_unlocked()
185 iop->_ptr += s; in _fwrite_unlocked()
[all …]
H A Dfopen.c65 FILE *iop; in fopen() local
68 iop = _findiop(); in fopen()
88 if (iop == NULL || iop->_flag == 0) { in _freopen_null()
104 if (!(iop->_flag & _IONBF) && (iop->_flag & (_IOWRT | _IOREAD | _IORW))) in _freopen_null()
110 iop->_base = NULL; in _freopen_null()
111 iop->_ptr = NULL; in _freopen_null()
119 iop->_cnt = 0; in _freopen_null()
122 fd = FILENO(iop); in _freopen_null()
168 iop->_flag = (iop->_flag & ~(_IOREAD | _IOWRT)) | _IORW; in _freopen_null()
198 return (iop); in _freopen_null()
[all …]
H A D_filbuf.c51 _filbuf(FILE *iop) in _filbuf() argument
72 if (iop->_base == 0) { in _filbuf()
78 endbuf = _bufend(iop); in _filbuf()
105 iop->_cnt = 0; in _filbuf()
113 iop->_ptr = iop->_base; in _filbuf()
118 if ((res = _xread(iop, (char *)iop->_base, nbyte)) > 0) { in _filbuf()
119 iop->_cnt = res - 1; in _filbuf()
120 return (*iop->_ptr++); in _filbuf()
123 iop->_cnt = 0; in _filbuf()
125 iop->_flag |= _IOEOF; in _filbuf()
[all …]
H A Dfseeko.c60 FLOCKFILE(lk, iop); in fseeko64()
61 iop->_flag &= ~_IOEOF; in fseeko64()
63 if (!(iop->_flag & _IOREAD) && !(iop->_flag & (_IOWRT | _IORW))) { in fseeko64()
69 if (iop->_flag & _IOREAD) { in fseeko64()
70 if (ptrname == 1 && iop->_base && !(iop->_flag&_IONBF)) { in fseeko64()
71 offset -= iop->_cnt; in fseeko64()
74 if (_fflush_u(iop) == EOF) { in fseeko64()
79 iop->_cnt = 0; in fseeko64()
80 iop->_ptr = iop->_base; in fseeko64()
81 if (iop->_flag & _IORW) { in fseeko64()
[all …]
H A Dftell.c51 ftell_common(FILE *iop) in ftell_common() argument
57 FLOCKFILE(lk, iop); in ftell_common()
67 if (_get_fd(iop) == -1) { in ftell_common()
68 (void) _fflush_u(iop); in ftell_common()
71 if (iop->_cnt < 0) in ftell_common()
72 iop->_cnt = 0; in ftell_common()
78 (iop->_base != 0)) { in ftell_common()
79 adjust = iop->_ptr - iop->_base; in ftell_common()
80 } else if ((iop->_flag & _IORW) && (iop->_base != 0)) { in ftell_common()
98 ftell(FILE *iop) in ftell() argument
[all …]
H A Dungetc.c41 int _ungetc_unlocked(int c, FILE *iop);
44 ungetc(int c, FILE *iop) in ungetc() argument
46 FLOCKRETURN(iop, _ungetc_unlocked(c, iop)) in ungetc()
55 _ungetc_unlocked(int c, FILE *iop) in _ungetc_unlocked() argument
59 if (iop->_ptr <= iop->_base) { in _ungetc_unlocked()
60 if (iop->_base == 0) { in _ungetc_unlocked()
61 if (_findbuf(iop) == 0) in _ungetc_unlocked()
63 } else if (iop->_ptr <= iop->_base - PUSHBACK) in _ungetc_unlocked()
67 ++iop->_ptr; in _ungetc_unlocked()
70 ++iop->_cnt; in _ungetc_unlocked()
[all …]
H A D_flsbuf.c47 _flsbuf(int ch, FILE *iop) in _flsbuf() argument
55 if (iop->_base != 0 && iop->_ptr > iop->_base) in _flsbuf()
59 if (iop->_ptr >= _bufend(iop)) in _flsbuf()
67 (void) _xflsbuf(iop); in _flsbuf()
68 iop->_cnt = 0; in _flsbuf()
71 iop->_cnt = 0; in _flsbuf()
73 if (_xwrite(iop, (char *)&uch, 1) != 1) { in _flsbuf()
75 iop->_flag |= _IOERR; in _flsbuf()
82 } while (iop->_flag & (_IOLBF | _IONBF)); in _flsbuf()
84 (void) _xflsbuf(iop); in _flsbuf()
[all …]
H A Dfseek.c53 FLOCKFILE(lk, iop); in fseek()
54 iop->_flag &= ~_IOEOF; in fseek()
56 if (!(iop->_flag & _IOREAD) && !(iop->_flag & (_IOWRT | _IORW))) { in fseek()
62 if (iop->_flag & _IOREAD) { in fseek()
63 if (ptrname == 1 && iop->_base && !(iop->_flag&_IONBF)) { in fseek()
64 offset -= iop->_cnt; in fseek()
67 if (_fflush_u(iop) == EOF) { in fseek()
72 iop->_cnt = 0; in fseek()
73 iop->_ptr = iop->_base; in fseek()
74 if (iop->_flag & _IORW) { in fseek()
[all …]
H A Dfgets.c54 FLOCKFILE(lk, iop); in fgets()
56 _SET_ORIENTATION_BYTE(iop); in fgets()
64 if (iop->_base == NULL) { in fgets()
71 bufend = _bufend(iop); in fgets()
76 if (iop->_cnt <= 0) { in fgets()
79 iop->_cnt++; in fgets()
86 n = (int)(size < iop->_cnt ? size : iop->_cnt); in fgets()
91 iop->_cnt -= n; in fgets()
92 iop->_ptr += n; in fgets()
93 if (_needsync(iop, bufend)) in fgets()
[all …]
H A Dfread.c54 FLOCKFILE(lk, iop); in fread()
60 iop->_flag |= _IOERR; in fread()
66 if (iop->_flag & _IOEOF) { in fread()
80 if (iop->_cnt < s) { in fread()
81 if (iop->_cnt > 0) { in fread()
83 iop->_cnt); in fread()
84 dptr += iop->_cnt; in fread()
85 s -= iop->_cnt; in fread()
96 if (iop->_cnt >= s) { in fread()
127 iop->_ptr += s; in fread()
[all …]
H A D_wrtchk.c43 _wrtchk(FILE *iop) in _wrtchk() argument
45 if ((iop->_flag & (_IOWRT | _IOEOF)) != _IOWRT) { in _wrtchk()
46 if (!(iop->_flag & (_IOWRT | _IORW))) { in _wrtchk()
47 iop->_flag |= _IOERR; in _wrtchk()
51 iop->_flag = (iop->_flag & ~_IOEOF) | _IOWRT; in _wrtchk()
55 if (iop->_base == NULL && _findbuf(iop) == NULL) in _wrtchk()
57 else if ((iop->_ptr == iop->_base) && in _wrtchk()
58 !(iop->_flag & (_IOLBF | _IONBF))) { in _wrtchk()
59 iop->_cnt = _bufend(iop) - iop->_ptr; in _wrtchk()
H A Ddoscan.c57 ((*iop->_ptr == '\0') ? EOF : *iop->_ptr++) : \
58 GETC(iop))
60 ((iop->_flag & _IOWRT) ? *(--iop->_ptr) : \
61 (++iop->_cnt, *(--iop->_ptr))))
64 ((*iop->_ptr == '\0') ? EOF : *iop->_ptr++) : \
65 GETC(iop))
67 ((iop->_flag & _IOWRT) ? *(--iop->_ptr) : \
831 if ((iop->_flag & _IOWRT) || (iop->_cnt != 0)) { in readchar()
1318 if (iop->_ptr <= iop->_base) {
1322 if ((iop->_ptr == iop->_base) && (iop->_cnt == 0)) {
[all …]
H A Dfputs.c57 FLOCKFILE(lk, iop); in fputs()
59 _SET_ORIENTATION_BYTE(iop); in fputs()
61 if (_WRTCHK(iop)) { in fputs()
65 bufend = _bufend(iop); in fputs()
72 if (_xflsbuf(iop) == EOF) { in fputs()
89 iop->_cnt -= len; in fputs()
90 iop->_ptr += len; in fputs()
91 if (_needsync(iop, bufend)) in fputs()
92 _bufsync(iop, bufend); in fputs()
100 if (iop->_flag & _IOLBF) in fputs()
[all …]
H A Drewind.c43 rewind(FILE *iop) in rewind() argument
47 FLOCKFILE(lk, iop); in rewind()
48 _rewind_unlocked(iop); in rewind()
53 _rewind_unlocked(FILE *iop) in _rewind_unlocked() argument
55 (void) _fflush_u(iop); in _rewind_unlocked()
56 (void) _xseek64(iop, 0, SEEK_SET); in _rewind_unlocked()
57 iop->_cnt = 0; in _rewind_unlocked()
58 iop->_ptr = iop->_base; in _rewind_unlocked()
59 iop->_flag &= ~(_IOERR | _IOEOF); in _rewind_unlocked()
60 if (iop->_flag & _IORW) in _rewind_unlocked()
[all …]
H A Dsetbuf.c45 setbuf(FILE *iop, char *abuf) in setbuf() argument
53 FLOCKFILE(lk, iop); in setbuf()
54 if ((iop->_base != NULL) && (iop->_flag & _IOMYBUF)) in setbuf()
55 free((char *)iop->_base - PUSHBACK); in setbuf()
58 iop->_flag |= _IONBF; in setbuf()
67 iop->_flag |= _IOMYBUF; in setbuf()
72 iop->_flag |= _IOLBF; in setbuf()
79 iop->_base = temp; in setbuf()
80 _setbufend(iop, temp + size); in setbuf()
81 iop->_ptr = temp; in setbuf()
[all …]
H A Dgetc.c46 getc(FILE *iop) in getc() argument
51 FLOCKFILE(lk, iop); in getc()
52 c = getc_unlocked(iop); in getc()
59 getc_unlocked(FILE *iop) in getc_unlocked() argument
61 _SET_ORIENTATION_BYTE(iop); in getc_unlocked()
62 return ((--iop->_cnt < 0) ? __filbuf(iop) : *iop->_ptr++); in getc_unlocked()
66 _getc_internal(FILE *iop) in _getc_internal() argument
68 return ((--iop->_cnt < 0) ? __filbuf(iop) : *iop->_ptr++); in _getc_internal()
H A Dsetvbuf.c46 int sflag = iop->_flag & _IOMYBUF; in setvbuf()
48 int fd = _get_fd(iop); in setvbuf()
50 FLOCKFILE(lk, iop); in setvbuf()
65 iop->_flag |= _IOMYBUF; in setvbuf()
87 iop->_flag |= _IOMYBUF; in setvbuf()
100 if (iop->_base != NULL && sflag) in setvbuf()
101 free((char *)iop->_base - PUSHBACK); in setvbuf()
103 iop->_base = temp; in setvbuf()
104 _setbufend(iop, temp + size); in setvbuf()
105 iop->_ptr = temp; in setvbuf()
[all …]
H A Dputc.c46 putc(int ch, FILE *iop) in putc() argument
51 FLOCKFILE(lk, iop); in putc()
52 ret = putc_unlocked(ch, iop); in putc()
58 putc_unlocked(int ch, FILE *iop) in putc_unlocked() argument
60 _SET_ORIENTATION_BYTE(iop); in putc_unlocked()
62 if (--iop->_cnt < 0) in putc_unlocked()
63 return (__flsbuf((unsigned char) ch, iop)); in putc_unlocked()
65 return (*iop->_ptr++ = (unsigned char)ch); in putc_unlocked()
69 _putc_internal(int ch, FILE *iop) in _putc_internal() argument
71 if (--iop->_cnt < 0) in _putc_internal()
[all …]
/illumos-gate/usr/src/cmd/bhyve/
H A Dinout.c108 bzero(&iop, sizeof(iop)); in register_default_iohandler()
166 iop = *iopp; in init_inout()
168 inout_handlers[iop->port].name = iop->name; in init_inout()
169 inout_handlers[iop->port].flags = iop->flags; in init_inout()
170 inout_handlers[iop->port].handler = iop->handler; in init_inout()
180 VERIFY_IOPORT(iop->port, iop->size); in register_inout()
187 for (i = iop->port; i < iop->port + iop->size; i++) { in register_inout()
193 for (i = iop->port; i < iop->port + iop->size; i++) { in register_inout()
207 VERIFY_IOPORT(iop->port, iop->size); in unregister_inout()
208 assert(inout_handlers[iop->port].name == iop->name); in unregister_inout()
[all …]
/illumos-gate/usr/src/ucblib/libucb/port/stdio/
H A Dfopen.c83 iop->_cnt = 0; in _endopen()
85 iop->_file = fd; in _endopen()
88 SET_FILE(iop, fd); in _endopen()
102 iop->_base = iop->_ptr = NULL; in _endopen()
108 return (iop); in _endopen()
114 FILE *iop; in fopen() local
117 iop = _findiop(); in fopen()
119 if (rc == NULL && iop != NULL) in fopen()
133 FILE *iop; in fopen64() local
136 iop = _findiop(); in fopen64()
[all …]
/illumos-gate/usr/src/lib/libc/port/locale/
H A Dungetwc.c62 FLOCKFILE(lk, iop); in __ungetwc_impl()
65 _setorientation(iop, _WC_MODE); in __ungetwc_impl()
78 if (iop->_ptr <= iop->_base) { in __ungetwc_impl()
79 if (iop->_base == NULL) { in __ungetwc_impl()
83 if (iop->_ptr == iop->_base && iop->_cnt == 0) { in __ungetwc_impl()
84 ++iop->_ptr; in __ungetwc_impl()
85 } else if ((iop->_ptr - n) < (iop->_base - PUSHBACK)) { in __ungetwc_impl()
93 *--(iop)->_ptr = (*p--); in __ungetwc_impl()
94 ++(iop)->_cnt; in __ungetwc_impl()
96 iop->_flag &= ~_IOEOF; in __ungetwc_impl()
[all …]
/illumos-gate/usr/src/ucblib/libucb/inc/
H A Dstdiom.h76 #define _bufend(iop) _realbufend(iop) argument
77 #define setbufend(iop, end) _setbufend(iop, end) argument
85 extern Uchar *_realbufend(FILE *iop);
87 extern int _wrtchk(FILE *iop);
93 extern int _xflsbuf(FILE *iop);
98 extern Uchar *_findbuf(FILE *iop);
102 #define SET_FILE(iop, fd) (iop)->_magic = (fd); (iop)->__extendedfd = 0 argument
117 #define _WRTCHK(iop) ((((iop->_flag & (_IOWRT | _IOEOF)) != _IOWRT) || \ argument
118 (iop->_base == 0) || \
119 (iop->_ptr == iop->_base && iop->_cnt == 0 && \
[all …]
/illumos-gate/usr/src/ucblib/libucb/port/gen/
H A Dsetbuffer.c57 if (iop->_base != 0 && iop->_flag & _IOMYBUF) in setbuffer()
61 iop->_flag |= _IONBF; in setbuffer()
71 iop->_flag |= _IOMYBUF; in setbuffer()
81 iop->_base = temp; in setbuffer()
82 _setbufend(iop, temp + size); in setbuffer()
83 iop->_ptr = temp; in setbuffer()
84 iop->_cnt = 0; in setbuffer()
92 setlinebuf(FILE *iop) in setlinebuf() argument
96 (void) fflush(iop); in setlinebuf()
100 setbuffer(iop, buf, 128); in setlinebuf()
[all …]

12345