Lines Matching refs:sflags
49 shf_open(const char *name, int oflags, int mode, int sflags)
54 sflags & SHF_UNBUF ? (sflags & SHF_RD ? 1 : 0) : SHF_BSIZE;
72 if ((sflags & SHF_MAPHI) && fd < FDBASE) {
85 sflags &= ~SHF_ACCMODE;
86 sflags |= (oflags & O_ACCMODE) == O_RDONLY ? SHF_RD :
89 return (shf_reopen(fd, sflags, shf));
96 int sflags = *sflagsp;
99 if (sflags & SHF_GETFL) {
104 sflags |= SHF_RDWR;
108 sflags |= SHF_RD;
111 sflags |= SHF_WR;
114 sflags |= SHF_RDWR;
118 *sflagsp = sflags;
121 if (!(sflags & (SHF_RD | SHF_WR)))
127 shf_fdopen(int fd, int sflags, struct shf *shf)
131 sflags & SHF_UNBUF ? (sflags & SHF_RD ? 1 : 0) : SHF_BSIZE;
133 shf_open_hlp(fd, &sflags, "shf_fdopen");
137 sflags |= SHF_ALLOCB;
143 sflags |= SHF_ALLOCS;
151 shf->wbsize = sflags & SHF_UNBUF ? 0 : bsize;
152 shf->flags = sflags;
155 if (sflags & SHF_CLEXEC)
162 shf_reopen(int fd, int sflags, struct shf *shf)
166 sflags & SHF_UNBUF ? (sflags & SHF_RD ? 1 : 0) : SHF_BSIZE;
168 shf_open_hlp(fd, &sflags, "shf_reopen");
178 shf->wbsize = sflags & SHF_UNBUF ? 0 : bsize;
179 shf->flags = (shf->flags & (SHF_ALLOCS | SHF_ALLOCB)) | sflags;
181 if (sflags & SHF_CLEXEC)
196 shf_sopen(char *buf, ssize_t bsize, int sflags, struct shf *shf)
199 if (!(!(sflags & SHF_RD) ^ !(sflags & SHF_WR)))
201 (unsigned int)sflags);
205 sflags |= SHF_ALLOCS;
208 if (!buf && (sflags & SHF_WR) && (sflags & SHF_DYNAMIC)) {
211 sflags |= SHF_ALLOCB;
220 shf->flags = sflags | SHF_STRING;