MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xlate_fflags

Function xlate_fflags

freebsd/kern/kern_descrip.c:4289–4320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4287#endif
4288
4289static int
4290xlate_fflags(int fflags)
4291{
4292 static const struct {
4293 int fflag;
4294 int kf_fflag;
4295 } fflags_table[] = {
4296 { FAPPEND, KF_FLAG_APPEND },
4297 { FASYNC, KF_FLAG_ASYNC },
4298 { FFSYNC, KF_FLAG_FSYNC },
4299 { FHASLOCK, KF_FLAG_HASLOCK },
4300 { FNONBLOCK, KF_FLAG_NONBLOCK },
4301 { FREAD, KF_FLAG_READ },
4302 { FWRITE, KF_FLAG_WRITE },
4303 { O_CREAT, KF_FLAG_CREAT },
4304 { O_DIRECT, KF_FLAG_DIRECT },
4305 { O_EXCL, KF_FLAG_EXCL },
4306 { O_EXEC, KF_FLAG_EXEC },
4307 { O_EXLOCK, KF_FLAG_EXLOCK },
4308 { O_NOFOLLOW, KF_FLAG_NOFOLLOW },
4309 { O_SHLOCK, KF_FLAG_SHLOCK },
4310 { O_TRUNC, KF_FLAG_TRUNC }
4311 };
4312 unsigned int i;
4313 int kflags;
4314
4315 kflags = 0;
4316 for (i = 0; i < nitems(fflags_table); i++)
4317 if (fflags & fflags_table[i].fflag)
4318 kflags |= fflags_table[i].kf_fflag;
4319 return (kflags);
4320}
4321
4322/* Trim unused data from kf_path by truncating the structure size. */
4323void

Callers 2

export_file_to_kinfoFunction · 0.85
export_vnode_to_kinfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected