/* A system call that opens a file identified by name in a given mode, and
returns a file descriptor uniquely identifying that file.
*/
-_PDCLIB_fd_t _PDCLIB_open( char const * const filename, int mode );
+_PDCLIB_fd_t _PDCLIB_open( char const * const filename, unsigned int mode );
/* A system call that writes n characters to a file identified by given file
descriptor. Return the number of characters written.
#include <fcntl.h>
#include <unistd.h>
-_PDCLIB_fd_t _PDCLIB_open( char const * const filename, int mode )
+_PDCLIB_fd_t _PDCLIB_open( char const * const filename, unsigned int mode )
{
int osmode = 0;
if ( mode & _PDCLIB_FRW ) osmode |= O_RDWR;
/* The unique file descriptor returned by _PDCLIB_open(). */
typedef int _PDCLIB_fd_t;
+/* The value (of type _PDCLIB_fd_t) returned by _PDCLIB_open() if the operation
+ failed.
+*/
+#define _PDCLIB_NOHANDLE -1
+
/* A type in which to store file offsets. See fgetpos() / fsetpos(). */
typedef struct
{