1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- fstat() now works with "NIL:" and "/dev/null", respectively. Not that

it returns much useful information, though.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15138 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2006-09-20 19:46:57 +00:00
parent 36c33073a5
commit 7b903355a7
5 changed files with 35 additions and 7 deletions

View File

@ -1,3 +1,6 @@
- fstat() now works with "NIL:" and "/dev/null", respectively. Not that
it returns much useful information, though.
- The _PC_MAX_INPUT query for file handles now returns the default
buffer size.

View File

@ -1,5 +1,5 @@
/*
* $Id: stat_convertfileinfo.c,v 1.8 2006-01-08 12:04:24 obarthel Exp $
* $Id: stat_convertfileinfo.c,v 1.9 2006-09-20 19:46:57 obarthel Exp $
*
* :ts=4
*
@ -81,7 +81,7 @@ __convert_file_info_to_stat(
mode = S_IFIFO;
else if (fib->fib_DirEntryType == ST_SOCKET)
mode = S_IFSOCK;
else if (fib->fib_DirEntryType == ST_CONSOLE)
else if (fib->fib_DirEntryType == ST_CONSOLE || fib->fib_DirEntryType == ST_NIL)
mode = S_IFCHR;
else if (fib->fib_DirEntryType < 0)
mode = S_IFREG;

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fdhookentry.c,v 1.32 2006-01-08 12:04:24 obarthel Exp $
* $Id: stdio_fdhookentry.c,v 1.33 2006-09-20 19:46:57 obarthel Exp $
*
* :ts=4
*
@ -581,7 +581,18 @@ __fd_hook_entry(
fh = BADDR(file);
if(CANNOT __safe_examine_file_handle(file,fam->fam_FileInfo))
/* Special treatment for "NIL:", for which we make
some stuff up. */
if(fh->fh_Type == NULL)
{
/* Make up some stuff for this stream. */
memset(fam->fam_FileInfo,0,sizeof(*fam->fam_FileInfo));
DateStamp(&fam->fam_FileInfo->fib_Date);
fam->fam_FileInfo->fib_DirEntryType = ST_NIL;
}
else if (CANNOT __safe_examine_file_handle(file,fam->fam_FileInfo))
{
LONG error;

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_headers.h,v 1.25 2006-01-08 12:04:24 obarthel Exp $
* $Id: stdio_headers.h,v 1.26 2006-09-20 19:46:57 obarthel Exp $
*
* :ts=4
*
@ -168,6 +168,9 @@ struct iob;
/* The same for a console stream. */
#define ST_CONSOLE (20050402)
/* And something for NIL: */
#define ST_NIL (20060920)
/****************************************************************************/
/* Operations that can be performed by the file action function. */

View File

@ -1,5 +1,5 @@
/*
* $Id: termios_console_fdhookentry.c,v 1.3 2006-09-12 14:16:44 obarthel Exp $
* $Id: termios_console_fdhookentry.c,v 1.4 2006-09-20 19:46:57 obarthel Exp $
*
* :ts=4
*
@ -589,7 +589,18 @@ __termios_console_hook(
fh = BADDR(file);
if(CANNOT __safe_examine_file_handle(file,fam->fam_FileInfo))
/* Special treatment for "NIL:", for which we make
some stuff up. */
if(fh->fh_Type == NULL)
{
/* Make up some stuff for this stream. */
memset(fam->fam_FileInfo,0,sizeof(*fam->fam_FileInfo));
DateStamp(&fam->fam_FileInfo->fib_Date);
fam->fam_FileInfo->fib_DirEntryType = ST_NIL;
}
else if (CANNOT __safe_examine_file_handle(file,fam->fam_FileInfo))
{
LONG error;