Changeset 0ffbed9 in mainline for uspace/lib/posix/sys/stat.c


Ignore:
Timestamp:
2011-06-19T17:49:29Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5974661
Parents:
f48b637 (diff), 32fb6944 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge libposix.

File:
1 edited

Legend:

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

    rf48b637 r0ffbed9  
    11/*
    22 * Copyright (c) 2011 Jiri Zarevucky
     3 * Copyright (c) 2011 Petr Koupy
    34 * All rights reserved.
    45 *
     
    2728 */
    2829
     30/** @addtogroup libposix
     31 * @{
     32 */
     33/** @file
     34 */
     35
    2936#define LIBPOSIX_INTERNAL
    3037
    3138#include "stat.h"
     39#include "../internal/common.h"
    3240#include <mem.h>
    3341
    34 /* Convert HelenOS stat struct into POSIX stat struct (if possible)
     42/**
     43 * Convert HelenOS stat struct into POSIX stat struct (if possible)
     44 *
     45 * @param dest
     46 * @param src
    3547 */
    36 static void stat_to_posix (struct posix_stat *dest, struct stat *src)
     48static void stat_to_posix(struct posix_stat *dest, struct stat *src)
    3749{
    3850        memset(dest, 0, sizeof(struct posix_stat));
     
    4254        /* HelenOS doesn't support permissions, so we set them all */
    4355        dest->st_mode = S_IRWXU | S_IRWXG | S_IRWXO;
    44         if (src->is_file)
     56        if (src->is_file) {
    4557                dest->st_mode |= S_IFREG;
    46         if (src->is_directory)
     58        }
     59        if (src->is_directory) {
    4760                dest->st_mode |= S_IFDIR;
     61        }
    4862       
    4963        dest->st_nlink = src->lnkcnt;
     
    5165}
    5266
     67/**
     68 *
     69 * @param fd
     70 * @param st
     71 * @return
     72 */
    5373int posix_fstat(int fd, struct posix_stat *st)
    5474{
     
    6282}
    6383
     84/**
     85 *
     86 * @param path
     87 * @param st
     88 * @return
     89 */
     90int posix_lstat(const char *restrict path, struct posix_stat *restrict st)
     91{
     92        // TODO
     93        not_implemented();
     94}
     95
     96/**
     97 *
     98 * @param path
     99 * @param st
     100 * @return
     101 */
    64102int posix_stat(const char *path, struct posix_stat *st)
    65103{
     
    73111}
    74112
     113/**
     114 *
     115 * @param path
     116 * @param mode
     117 * @return
     118 */
     119int posix_chmod(const char *path, mode_t mode)
     120{
     121        // TODO
     122        not_implemented();
     123}
     124
     125/**
     126 *
     127 * @param mask
     128 * @return
     129 */
     130mode_t posix_umask(mode_t mask)
     131{
     132        // TODO
     133        not_implemented();
     134}
     135
     136/** @}
     137 */
Note: See TracChangeset for help on using the changeset viewer.