[a16210b5] | 1 | /*
|
---|
| 2 | * Copyright (c) 2011 Jiri Zarevucky
|
---|
[4f4b4e7] | 3 | * Copyright (c) 2011 Petr Koupy
|
---|
[a16210b5] | 4 | * All rights reserved.
|
---|
| 5 | *
|
---|
| 6 | * Redistribution and use in source and binary forms, with or without
|
---|
| 7 | * modification, are permitted provided that the following conditions
|
---|
| 8 | * are met:
|
---|
| 9 | *
|
---|
| 10 | * - Redistributions of source code must retain the above copyright
|
---|
| 11 | * notice, this list of conditions and the following disclaimer.
|
---|
| 12 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 13 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 14 | * documentation and/or other materials provided with the distribution.
|
---|
| 15 | * - The name of the author may not be used to endorse or promote products
|
---|
| 16 | * derived from this software without specific prior written permission.
|
---|
| 17 | *
|
---|
| 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 28 | */
|
---|
| 29 |
|
---|
[4f4b4e7] | 30 | /** @addtogroup libposix
|
---|
| 31 | * @{
|
---|
| 32 | */
|
---|
| 33 | /** @file
|
---|
| 34 | */
|
---|
| 35 |
|
---|
[491e1ee] | 36 | #define LIBPOSIX_INTERNAL
|
---|
[4f4b4e7] | 37 |
|
---|
[9b1503e] | 38 | #include "internal/common.h"
|
---|
[a16210b5] | 39 | #include "unistd.h"
|
---|
[823a929] | 40 | #include <task.h>
|
---|
[a16210b5] | 41 |
|
---|
[b4d6252] | 42 | /* Array of environment variable strings (NAME=VALUE). */
|
---|
[7530a00] | 43 | char **posix_environ = NULL;
|
---|
[b4d6252] | 44 |
|
---|
[4f4b4e7] | 45 | /**
|
---|
[8d7e82c1] | 46 | * Dummy function. Always returns false, because there is no easy way to find
|
---|
| 47 | * out under HelenOS.
|
---|
| 48 | *
|
---|
[4f4b4e7] | 49 | * @param fd
|
---|
[8d7e82c1] | 50 | * @return Always false.
|
---|
[4f4b4e7] | 51 | */
|
---|
| 52 | int posix_isatty(int fd)
|
---|
| 53 | {
|
---|
[8d7e82c1] | 54 | return false;
|
---|
[a16210b5] | 55 | }
|
---|
| 56 |
|
---|
[72ec8cc] | 57 | /**
|
---|
| 58 | *
|
---|
| 59 | * @return
|
---|
| 60 | */
|
---|
| 61 | int posix_getpagesize(void)
|
---|
| 62 | {
|
---|
| 63 | return getpagesize();
|
---|
| 64 | }
|
---|
| 65 |
|
---|
[823a929] | 66 | /**
|
---|
| 67 | *
|
---|
| 68 | * @return
|
---|
| 69 | */
|
---|
| 70 | posix_pid_t posix_getpid(void)
|
---|
| 71 | {
|
---|
| 72 | return task_get_id();
|
---|
| 73 | }
|
---|
| 74 |
|
---|
[59f799b] | 75 | /**
|
---|
| 76 | *
|
---|
| 77 | * @return
|
---|
| 78 | */
|
---|
| 79 | posix_uid_t posix_getuid(void)
|
---|
| 80 | {
|
---|
| 81 | // TODO
|
---|
| 82 | not_implemented();
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 | /**
|
---|
| 86 | *
|
---|
| 87 | * @return
|
---|
| 88 | */
|
---|
| 89 | posix_gid_t posix_getgid(void)
|
---|
| 90 | {
|
---|
| 91 | // TODO
|
---|
| 92 | not_implemented();
|
---|
| 93 | }
|
---|
| 94 |
|
---|
[b08ef1fd] | 95 | /**
|
---|
| 96 | *
|
---|
| 97 | * @param path
|
---|
| 98 | * @param amode
|
---|
| 99 | * @return
|
---|
| 100 | */
|
---|
| 101 | int posix_access(const char *path, int amode)
|
---|
| 102 | {
|
---|
| 103 | // TODO
|
---|
| 104 | not_implemented();
|
---|
| 105 | }
|
---|
| 106 |
|
---|
[59f799b] | 107 | /**
|
---|
| 108 | *
|
---|
| 109 | * @param name
|
---|
| 110 | * @return
|
---|
| 111 | */
|
---|
| 112 | long posix_sysconf(int name)
|
---|
| 113 | {
|
---|
| 114 | // TODO
|
---|
| 115 | not_implemented();
|
---|
| 116 | }
|
---|
| 117 |
|
---|
[823a929] | 118 | /**
|
---|
| 119 | *
|
---|
| 120 | * @param path
|
---|
| 121 | * @param name
|
---|
| 122 | * @return
|
---|
| 123 | */
|
---|
| 124 | long posix_pathconf(const char *path, int name)
|
---|
| 125 | {
|
---|
| 126 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 127 | not_implemented();
|
---|
| 128 | }
|
---|
| 129 |
|
---|
| 130 | /**
|
---|
| 131 | *
|
---|
| 132 | * @return
|
---|
| 133 | */
|
---|
| 134 | posix_pid_t posix_fork(void)
|
---|
| 135 | {
|
---|
| 136 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 137 | not_implemented();
|
---|
| 138 | }
|
---|
| 139 |
|
---|
| 140 | /**
|
---|
| 141 | *
|
---|
| 142 | * @param path
|
---|
| 143 | * @param argv
|
---|
| 144 | * @return
|
---|
| 145 | */
|
---|
| 146 | int posix_execv(const char *path, char *const argv[])
|
---|
| 147 | {
|
---|
| 148 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 149 | not_implemented();
|
---|
| 150 | }
|
---|
| 151 |
|
---|
| 152 | /**
|
---|
| 153 | *
|
---|
| 154 | * @param file
|
---|
| 155 | * @param argv
|
---|
| 156 | * @return
|
---|
| 157 | */
|
---|
| 158 | int posix_execvp(const char *file, char *const argv[])
|
---|
| 159 | {
|
---|
| 160 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 161 | not_implemented();
|
---|
| 162 | }
|
---|
| 163 |
|
---|
| 164 | /**
|
---|
| 165 | *
|
---|
| 166 | * @param fildes
|
---|
| 167 | * @return
|
---|
| 168 | */
|
---|
| 169 | int posix_pipe(int fildes[2])
|
---|
| 170 | {
|
---|
| 171 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 172 | not_implemented();
|
---|
| 173 | }
|
---|
| 174 |
|
---|
[4f4b4e7] | 175 | /** @}
|
---|
| 176 | */
|
---|