* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)flags.c 5.1 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
* Return the (stdio) flags for a given mode. Store the flags
* to be passed to an open() syscall through *optr.
case 'r': /* open for reading */
case 'w': /* open for writing */
case 'a': /* open for appending */
default: /* illegal mode */
/* [rwa]\+ or [rwa]b\+ means read and write */
if (*mode
== '+' || (*mode
== 'b' && mode
[1] == '+')) {