start service tasks separately in-case platforms need to perform additional set-up...
[AROS.git] / compiler / posixc / dirfd.c
blob4a0b1e35dda0b8e3c18db441c31c29c825e2db3a
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX.1-2008 function dirfd().
6 */
8 #define DEBUG 0
9 #include <aros/debug.h>
11 #include "__dirdesc.h"
13 /*****************************************************************************
15 NAME */
16 #include <dirent.h>
18 int dirfd(
20 /* SYNOPSIS */
21 DIR *dir)
23 /* FUNCTION
24 get directory stream file descriptor
26 INPUTS
27 dir - directory stream dir.
29 RESULT
30 on error -1 is returned.
32 NOTES
33 This descriptor is the one used internally by the directory stream. As
34 a result, it is only useful for functions which do not depend on or
35 alter the file position, such as fstat(2) and fchdir(2). It will be
36 automatically closed when closedir(3) is called.
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 open(), readdir(), closedir(), rewinddir(), seekdir(),
44 telldir()
46 INTERNALS
48 ******************************************************************************/
50 D(bug("dirfd()=%d\n", dir->fd));
51 return dir->fd;