X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcfileutil.h;h=151f45a4f0572c8951c4111b4674ad92affcbacb;hb=51558729d89b9f3492b2ca754242ed548a579ca4;hp=70887760e0dad3e455e44796b141950369fbc47d;hpb=1c3ae0efc13419718213114e140c3d83b4608c1e;p=runtime.git diff --git a/lib/silcutil/silcfileutil.h b/lib/silcutil/silcfileutil.h index 70887760..151f45a4 100644 --- a/lib/silcutil/silcfileutil.h +++ b/lib/silcutil/silcfileutil.h @@ -41,7 +41,8 @@ * * Opens a file indicated by the filename `filename' with flags indicated * by `flags'. The opening permission defaults to 0600. The `flags' - * are defined in open(2). + * are defined in open(2). Returns the opened file descriptor or -1 on + * error. * ***/ int silc_file_open(const char *filename, int flags); @@ -57,6 +58,7 @@ int silc_file_open(const char *filename, int flags); * Opens a file indicated by the filename `filename' with flags indicated * by `flags'. The argument `mode' specifies the permissions to use in * case a new file is created. The `flags' are defined in open(2). + * Returns the opened file descriptor or -1 on error. * ***/ int silc_file_open_mode(const char *filename, int flags, int mode); @@ -69,7 +71,8 @@ int silc_file_open_mode(const char *filename, int flags, int mode); * * DESCRIPTION * - * Reads data from file descriptor `fd' to `buf'. + * Reads data from file descriptor `fd' to `buf'. Returns the amount of + * bytes read, 0 on EOF or -1 on error. * ***/ int silc_file_read(int fd, unsigned char *buf, SilcUInt32 buf_len); @@ -82,7 +85,8 @@ int silc_file_read(int fd, unsigned char *buf, SilcUInt32 buf_len); * * DESCRIPTION * - * Writes `buffer' of length of `len' to file descriptor `fd'. + * Writes `buffer' of length of `len' to file descriptor `fd'. Returns + * the amount of bytes written, 0 on EOF or -1 on error. * ***/ int silc_file_write(int fd, const char *buffer, SilcUInt32 len); @@ -96,6 +100,7 @@ int silc_file_write(int fd, const char *buffer, SilcUInt32 len); * DESCRIPTION * * Closes file descriptor previously opened with silc_file_open(). + * Returns 0 on success or -1 on error. * ***/ int silc_file_close(int fd);