diff options
Diffstat (limited to 'vms')
-rw-r--r-- | vms/ChangeLog | 18 | ||||
-rw-r--r-- | vms/gawkmisc.vms | 26 |
2 files changed, 44 insertions, 0 deletions
diff --git a/vms/ChangeLog b/vms/ChangeLog index fa1fbd16..725a223b 100644 --- a/vms/ChangeLog +++ b/vms/ChangeLog @@ -1,7 +1,25 @@ +2012-08-08 Arnold D. Robbins <arnold@skeeve.com> + + * gawkmisc.pc (os_isreadable): Take IOBUF_PUBLIC instead of fd and + use passed in info. + +2012-07-29 Arnold D. Robbins <arnold@skeeve.com> + + * gawkmisc.vms (os_isreadable): Add isdir pointer parameter to be + set to true if fd is for a directory. + +2012-07-26 Arnold D. Robbins <arnold@skeeve.com> + + * gawkmisc.vms (os_isreadable): New function. + 2012-03-29 Arnold D. Robbins <arnold@skeeve.com> * config.h: Add definition for _Noreturn. +2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * gawkmisc.vms (deflibpath): New global variable. + 2012-03-28 Arnold D. Robbins <arnold@skeeve.com> * 4.0.1: Release tar ball made. diff --git a/vms/gawkmisc.vms b/vms/gawkmisc.vms index 346a1e88..0ca3e0bf 100644 --- a/vms/gawkmisc.vms +++ b/vms/gawkmisc.vms @@ -25,6 +25,7 @@ char quote = '\''; char *defpath = DEFPATH; +char *deflibpath = DEFLIBPATH; char envsep = ','; /* gawk_name --- pull out the "gawk" part from how the OS called us */ @@ -143,6 +144,31 @@ int fd; return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)); } +/* os_isreadable --- fd can be read from */ + +int +os_isreadable(const IOBUF_PUBLIC *iobuf, bool *isdir) +{ + *isdir = false; + + switch (iobuf->sbuf.st_mode & S_IFMT) { + case S_IFREG: + case S_IFCHR: /* ttys, /dev/null, .. */ +#ifdef S_IFSOCK + case S_IFSOCK: +#endif +#ifdef S_IFIFO + case S_IFIFO: +#endif + return true; + case S_IFDIR: + *isdir = true; + /* fall through */ + default: + return false; + } +} + /* os_is_setuid --- true if running setuid root */ int |