Lines Matching refs:sflags

51 shf_open(const char *name, int oflags, int mode, int sflags)  in shf_open()  argument
56 sflags & SHF_UNBUF ? (sflags & SHF_RD ? 1 : 0) : SHF_BSIZE; in shf_open()
74 if ((sflags & SHF_MAPHI) && fd < FDBASE) { in shf_open()
87 sflags &= ~SHF_ACCMODE; in shf_open()
88 sflags |= (oflags & O_ACCMODE) == O_RDONLY ? SHF_RD : in shf_open()
91 return (shf_reopen(fd, sflags, shf)); in shf_open()
98 int sflags = *sflagsp; in shf_open_hlp() local
101 if (sflags & SHF_GETFL) { in shf_open_hlp()
106 sflags |= SHF_RDWR; in shf_open_hlp()
110 sflags |= SHF_RD; in shf_open_hlp()
113 sflags |= SHF_WR; in shf_open_hlp()
116 sflags |= SHF_RDWR; in shf_open_hlp()
120 *sflagsp = sflags; in shf_open_hlp()
123 if (!(sflags & (SHF_RD | SHF_WR))) in shf_open_hlp()
129 shf_fdopen(int fd, int sflags, struct shf *shf) in shf_fdopen() argument
133 sflags & SHF_UNBUF ? (sflags & SHF_RD ? 1 : 0) : SHF_BSIZE; in shf_fdopen()
135 shf_open_hlp(fd, &sflags, "shf_fdopen"); in shf_fdopen()
139 sflags |= SHF_ALLOCB; in shf_fdopen()
145 sflags |= SHF_ALLOCS; in shf_fdopen()
153 shf->wbsize = sflags & SHF_UNBUF ? 0 : bsize; in shf_fdopen()
154 shf->flags = sflags; in shf_fdopen()
157 if (sflags & SHF_CLEXEC) in shf_fdopen()
164 shf_reopen(int fd, int sflags, struct shf *shf) in shf_reopen() argument
168 sflags & SHF_UNBUF ? (sflags & SHF_RD ? 1 : 0) : SHF_BSIZE; in shf_reopen()
170 shf_open_hlp(fd, &sflags, "shf_reopen"); in shf_reopen()
180 shf->wbsize = sflags & SHF_UNBUF ? 0 : bsize; in shf_reopen()
181 shf->flags = (shf->flags & (SHF_ALLOCS | SHF_ALLOCB)) | sflags; in shf_reopen()
183 if (sflags & SHF_CLEXEC) in shf_reopen()
198 shf_sopen(char *buf, ssize_t bsize, int sflags, struct shf *shf) in shf_sopen() argument
201 if (!(!(sflags & SHF_RD) ^ !(sflags & SHF_WR))) in shf_sopen()
203 (unsigned int)sflags); in shf_sopen()
207 sflags |= SHF_ALLOCS; in shf_sopen()
210 if (!buf && (sflags & SHF_WR) && (sflags & SHF_DYNAMIC)) { in shf_sopen()
213 sflags |= SHF_ALLOCB; in shf_sopen()
222 shf->flags = sflags | SHF_STRING; in shf_sopen()