Changeset b08ef1fd in mainline


Ignore:
Timestamp:
2011-06-16T02:57:47Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
491e1ee
Parents:
4f4b4e7
Message:

POSIX types moved from stat.h to types.h.
Added function stubs into stdio.h and unistd.h.

Location:
uspace/lib/posix
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/stdio.c

    r4f4b4e7 rb08ef1fd  
    111111}
    112112
     113/**
     114 *
     115 * @param stream
     116 * @param offset
     117 * @param whence
     118 * @return
     119 */
     120int posix_fseeko(FILE *stream, posix_off_t offset, int whence)
     121{
     122        // TODO
     123        not_implemented();
     124}
     125
     126/**
     127 *
     128 * @param stream
     129 * @return
     130 */
     131posix_off_t posix_ftello(FILE *stream)
     132{
     133        // TODO
     134        not_implemented();
     135}
     136
    113137/** @}
    114138 */
  • uspace/lib/posix/stdio.h

    r4f4b4e7 rb08ef1fd  
    3838
    3939#include "libc/stdio.h"
     40#include "sys/types.h"
    4041
    4142/* Character Input/Output */
     
    5253extern void posix_perror(const char *s);
    5354
     55/* File Positioning */
     56extern int posix_fseeko(FILE *stream, posix_off_t offset, int whence);
     57extern posix_off_t posix_ftello(FILE *stream);
     58
    5459#ifndef POSIX_INTERNAL
    5560        #define freopen posix_freopen
    5661
    5762        #define perror posix_perror
     63
     64        #define fseeko posix_fseeko
     65        #define ftello posix_ftello
    5866#endif
    5967
  • uspace/lib/posix/sys/stat.h

    r4f4b4e7 rb08ef1fd  
    3838
    3939#include "../libc/sys/stat.h"
    40 #include "time.h"
     40#include "types.h"
     41#include "../time.h"
    4142
    4243/* values are the same as on Linux */
     
    108109#define S_ISSOCK(m) ((m & S_IFSOCK) != 0) /* socket? (Not in POSIX.1-1996.) */
    109110
    110 typedef devmap_handle_t posix_dev_t;
    111 typedef unsigned int posix_ino_t;
    112 typedef unsigned int posix_nlink_t;
    113 typedef unsigned int posix_uid_t;
    114 typedef unsigned int posix_gid_t;
    115 typedef aoff64_t posix_off_t;
    116 typedef unsigned int posix_blksize_t;
    117 typedef unsigned int posix_blkcnt_t;
    118 
    119111struct posix_stat {
    120112        struct stat sys_stat;
     
    139131
    140132#ifndef LIBPOSIX_INTERNAL
    141         #define dev_t posix_dev_t
    142         #define nlink_t posix_nlink_t
    143         #define uid_t posix_uid_t
    144         #define gid_t posix_gid_t
    145         #define off_t posix_off_t
    146         #define blksize_t posix_blksize_t
    147         #define blkcnt_t posix_blkcnt_t
    148 
    149133        #define fstat posix_fstat
    150134        #define stat posix_stat
  • uspace/lib/posix/sys/types.h

    r4f4b4e7 rb08ef1fd  
    3838
    3939#include "../libc/sys/types.h"
     40#include <ipc/devmap.h>
    4041#include <task.h>
    4142
    4243typedef task_id_t posix_pid_t;
     44typedef devmap_handle_t posix_dev_t;
     45typedef unsigned int posix_ino_t;
     46typedef unsigned int posix_nlink_t;
     47typedef unsigned int posix_uid_t;
     48typedef unsigned int posix_gid_t;
     49typedef aoff64_t posix_off_t;
     50typedef unsigned int posix_blksize_t;
     51typedef unsigned int posix_blkcnt_t;
    4352
    4453#ifndef POSIX_INTERNAL
    4554        #define pid_t posix_pid_t
     55        #define dev_t posix_dev_t
     56        #define nlink_t posix_nlink_t
     57        #define uid_t posix_uid_t
     58        #define gid_t posix_gid_t
     59        #define off_t posix_off_t
     60        #define blksize_t posix_blksize_t
     61        #define blkcnt_t posix_blkcnt_t
    4662#endif
    4763
  • uspace/lib/posix/unistd.c

    r4f4b4e7 rb08ef1fd  
    5050}
    5151
     52/**
     53 *
     54 * @param path
     55 * @param amode
     56 * @return
     57 */
     58int posix_access(const char *path, int amode)
     59{
     60        // TODO
     61        not_implemented();
     62}
     63
    5264/** @}
    5365 */
  • uspace/lib/posix/unistd.h

    r4f4b4e7 rb08ef1fd  
    6161#define STDERR_FILENO (fileno(stderr))
    6262
     63/* File Accessibility */
     64#undef F_OK
     65#undef X_OK
     66#undef W_OK
     67#undef R_OK
     68#define F_OK 0 /* Test for existence. */
     69#define X_OK 1 /* Test for execute permission. */
     70#define W_OK 2 /* Test for write permission. */
     71#define R_OK 4 /* Test for read permission. */
     72extern int posix_access(const char *path, int amode);
     73
    6374#ifndef POSIX_INTERNAL
    6475        #define isatty posix_isatty
     76
     77        #define access posix_access
    6578#endif
    6679
Note: See TracChangeset for help on using the changeset viewer.