[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 |
|
---|
[244d6fd] | 45 | /**
|
---|
| 46 | * Get current user name.
|
---|
| 47 | */
|
---|
| 48 | char *posix_getlogin(void)
|
---|
| 49 | {
|
---|
| 50 | // TODO
|
---|
| 51 | return (char *) "user";
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | /**
|
---|
| 55 | * Get current user name.
|
---|
| 56 | *
|
---|
| 57 | * @param name Pointer to a user supplied buffer.
|
---|
| 58 | * @param namesize Length of the buffer.
|
---|
| 59 | * @return
|
---|
| 60 | */
|
---|
| 61 | int posix_getlogin_r(char *name, size_t namesize)
|
---|
| 62 | {
|
---|
| 63 | // TODO
|
---|
| 64 | not_implemented();
|
---|
| 65 | }
|
---|
| 66 |
|
---|
[4f4b4e7] | 67 | /**
|
---|
[8d7e82c1] | 68 | * Dummy function. Always returns false, because there is no easy way to find
|
---|
| 69 | * out under HelenOS.
|
---|
| 70 | *
|
---|
[4f4b4e7] | 71 | * @param fd
|
---|
[8d7e82c1] | 72 | * @return Always false.
|
---|
[4f4b4e7] | 73 | */
|
---|
| 74 | int posix_isatty(int fd)
|
---|
| 75 | {
|
---|
[8d7e82c1] | 76 | return false;
|
---|
[a16210b5] | 77 | }
|
---|
| 78 |
|
---|
[72ec8cc] | 79 | /**
|
---|
| 80 | *
|
---|
| 81 | * @return
|
---|
| 82 | */
|
---|
| 83 | int posix_getpagesize(void)
|
---|
| 84 | {
|
---|
| 85 | return getpagesize();
|
---|
| 86 | }
|
---|
| 87 |
|
---|
[823a929] | 88 | /**
|
---|
| 89 | *
|
---|
| 90 | * @return
|
---|
| 91 | */
|
---|
| 92 | posix_pid_t posix_getpid(void)
|
---|
| 93 | {
|
---|
| 94 | return task_get_id();
|
---|
| 95 | }
|
---|
| 96 |
|
---|
[59f799b] | 97 | /**
|
---|
| 98 | *
|
---|
| 99 | * @return
|
---|
| 100 | */
|
---|
| 101 | posix_uid_t posix_getuid(void)
|
---|
| 102 | {
|
---|
| 103 | // TODO
|
---|
| 104 | not_implemented();
|
---|
| 105 | }
|
---|
| 106 |
|
---|
| 107 | /**
|
---|
| 108 | *
|
---|
| 109 | * @return
|
---|
| 110 | */
|
---|
| 111 | posix_gid_t posix_getgid(void)
|
---|
| 112 | {
|
---|
| 113 | // TODO
|
---|
| 114 | not_implemented();
|
---|
| 115 | }
|
---|
| 116 |
|
---|
[b08ef1fd] | 117 | /**
|
---|
| 118 | *
|
---|
| 119 | * @param path
|
---|
| 120 | * @param amode
|
---|
| 121 | * @return
|
---|
| 122 | */
|
---|
| 123 | int posix_access(const char *path, int amode)
|
---|
| 124 | {
|
---|
| 125 | // TODO
|
---|
| 126 | not_implemented();
|
---|
| 127 | }
|
---|
| 128 |
|
---|
[59f799b] | 129 | /**
|
---|
| 130 | *
|
---|
| 131 | * @param name
|
---|
| 132 | * @return
|
---|
| 133 | */
|
---|
| 134 | long posix_sysconf(int name)
|
---|
| 135 | {
|
---|
| 136 | // TODO
|
---|
| 137 | not_implemented();
|
---|
| 138 | }
|
---|
| 139 |
|
---|
[823a929] | 140 | /**
|
---|
| 141 | *
|
---|
| 142 | * @param path
|
---|
| 143 | * @param name
|
---|
| 144 | * @return
|
---|
| 145 | */
|
---|
| 146 | long posix_pathconf(const char *path, int name)
|
---|
| 147 | {
|
---|
| 148 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 149 | not_implemented();
|
---|
| 150 | }
|
---|
| 151 |
|
---|
| 152 | /**
|
---|
| 153 | *
|
---|
| 154 | * @return
|
---|
| 155 | */
|
---|
| 156 | posix_pid_t posix_fork(void)
|
---|
| 157 | {
|
---|
| 158 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 159 | not_implemented();
|
---|
| 160 | }
|
---|
| 161 |
|
---|
| 162 | /**
|
---|
| 163 | *
|
---|
| 164 | * @param path
|
---|
| 165 | * @param argv
|
---|
| 166 | * @return
|
---|
| 167 | */
|
---|
| 168 | int posix_execv(const char *path, char *const argv[])
|
---|
| 169 | {
|
---|
| 170 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 171 | not_implemented();
|
---|
| 172 | }
|
---|
| 173 |
|
---|
| 174 | /**
|
---|
| 175 | *
|
---|
| 176 | * @param file
|
---|
| 177 | * @param argv
|
---|
| 178 | * @return
|
---|
| 179 | */
|
---|
| 180 | int posix_execvp(const char *file, char *const argv[])
|
---|
| 181 | {
|
---|
| 182 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 183 | not_implemented();
|
---|
| 184 | }
|
---|
| 185 |
|
---|
| 186 | /**
|
---|
| 187 | *
|
---|
| 188 | * @param fildes
|
---|
| 189 | * @return
|
---|
| 190 | */
|
---|
| 191 | int posix_pipe(int fildes[2])
|
---|
| 192 | {
|
---|
| 193 | // TODO: low priority, just a compile-time dependency of binutils
|
---|
| 194 | not_implemented();
|
---|
| 195 | }
|
---|
| 196 |
|
---|
[4f4b4e7] | 197 | /** @}
|
---|
| 198 | */
|
---|