Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 3daf2c31 in mainline


Ignore:
Timestamp:
2011-06-29T23:21:07Z (11 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master
Children:
9067152
Parents:
87ba48cb
Message:

Implemented and commented rest of the functions in sys/stat.c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/sys/stat.c

    r87ba48cb r3daf2c31  
    4141
    4242/**
    43  * Convert HelenOS stat struct into POSIX stat struct (if possible)
     43 * Convert HelenOS stat struct into POSIX stat struct (if possible).
    4444 *
    45  * @param dest
    46  * @param src
     45 * @param dest POSIX stat struct.
     46 * @param src HelenOS stat struct.
    4747 */
    4848static void stat_to_posix(struct posix_stat *dest, struct stat *src)
     
    6666
    6767/**
     68 * Retrieve file status for file associated with file descriptor.
    6869 *
    69  * @param fd
    70  * @param st
    71  * @return
     70 * @param fd File descriptor of the opened file.
     71 * @param st Status structure to be filled with information.
     72 * @return Zero on success, -1 otherwise.
    7273 */
    7374int posix_fstat(int fd, struct posix_stat *st)
     
    8384
    8485/**
     86 * Retrieve file status for symbolic link.
    8587 *
    86  * @param path
    87  * @param st
    88  * @return
     88 * @param path Path to the symbolic link.
     89 * @param st Status structure to be filled with information.
     90 * @return Zero on success, -1 otherwise.
    8991 */
    90 int posix_lstat(const char *restrict path, struct posix_stat *restrict st)
     92int posix_lstat(const char *path, struct posix_stat *st)
    9193{
    92         // TODO
    93         not_implemented();
     94        /* There are currently no symbolic links in HelenOS. */
     95        return posix_stat(path, st);
    9496}
    9597
    9698/**
     99 * Retrieve file status for regular file (or symbolic link target).
    97100 *
    98  * @param path
    99  * @param st
    100  * @return
     101 * @param path Path to the file/link.
     102 * @param st Status structure to be filled with information.
     103 * @return Zero on success, -1 otherwise.
    101104 */
    102105int posix_stat(const char *path, struct posix_stat *st)
     
    112115
    113116/**
     117 * Change permission bits for the file if possible.
    114118 *
    115  * @param path
    116  * @param mode
    117  * @return
     119 * @param path Path to the file.
     120 * @param mode Permission bits to be set.
     121 * @return Zero on success, -1 otherwise.
    118122 */
    119123int posix_chmod(const char *path, mode_t mode)
    120124{
    121         // TODO
    122         not_implemented();
     125        /* HelenOS doesn't support permissions, return success. */
     126        return 0;
    123127}
    124128
    125129/**
     130 * Set the file mode creation mask of the process.
    126131 *
    127  * @param mask
    128  * @return
     132 * @param mask Set permission bits are cleared in the related creation
     133 *     functions. Non-permission bits are ignored.
     134 * @return Previous file mode creation mask.
    129135 */
    130136mode_t posix_umask(mode_t mask)
    131137{
    132         // TODO
    133         not_implemented();
     138        /* HelenOS doesn't support permissions, return empty mask. */
     139        return 0;
    134140}
    135141
Note: See TracChangeset for help on using the changeset viewer.