Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
unistd.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Intel Corporation
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
#ifndef ZEPHYR_INCLUDE_POSIX_UNISTD_H_
7
#define ZEPHYR_INCLUDE_POSIX_UNISTD_H_
8
9
#include <time.h>
10
11
#include <
zephyr/posix/posix_types.h
>
12
13
#ifdef CONFIG_POSIX_API
14
#include <
zephyr/fs/fs.h
>
15
#endif
16
#include <
zephyr/posix/sys/confstr.h
>
17
#include <
zephyr/posix/sys/stat.h
>
18
#include <
zephyr/posix/sys/sysconf.h
>
19
20
#include "
posix_features.h
"
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
26
#ifdef CONFIG_POSIX_API
27
/* File related operations */
28
int
close(
int
file);
29
ssize_t
write(
int
file,
const
void
*buffer,
size_t
count);
30
ssize_t
read(
int
file,
void
*buffer,
size_t
count);
31
off_t
lseek(
int
file,
off_t
offset,
int
whence);
32
int
fsync(
int
fd);
33
int
ftruncate(
int
fd,
off_t
length);
34
35
#ifdef CONFIG_POSIX_SYNCHRONIZED_IO
36
int
fdatasync(
int
fd);
37
#endif
/* CONFIG_POSIX_SYNCHRONIZED_IO */
38
39
/* File System related operations */
40
int
rename(
const
char
*old,
const
char
*newp);
41
int
unlink(
const
char
*path);
42
int
stat
(
const
char
*path,
struct
stat
*buf);
43
int
mkdir
(
const
char
*path,
mode_t
mode);
44
int
rmdir(
const
char
*path);
45
46
FUNC_NORETURN
void
_exit(
int
status);
47
48
int
gethostname(
char
*buf,
size_t
len);
49
50
#endif
/* CONFIG_POSIX_API */
51
52
#ifdef CONFIG_POSIX_C_LIB_EXT
53
int
getopt(
int
argc,
char
*
const
argv[],
const
char
*optstring);
54
extern
char
*optarg;
55
extern
int
opterr, optind, optopt;
56
#endif
57
58
int
getentropy
(
void
*buffer,
size_t
length);
59
pid_t
getpid
(
void
);
60
unsigned
sleep
(
unsigned
int
seconds);
61
int
usleep
(
useconds_t
useconds);
62
#if _POSIX_C_SOURCE >= 2
63
size_t
confstr(
int
name,
char
*buf,
size_t
len);
64
#endif
65
66
#ifdef CONFIG_POSIX_SYSCONF_IMPL_MACRO
67
#define sysconf(x) (long)CONCAT(__z_posix_sysconf, x)
68
#else
69
long
sysconf
(
int
opt);
70
#endif
/* CONFIG_POSIX_SYSCONF_IMPL_FULL */
71
72
#if _XOPEN_SOURCE >= 500
73
long
gethostid(
void
);
74
#endif
75
76
#ifdef __cplusplus
77
}
78
#endif
79
80
#endif
/* ZEPHYR_INCLUDE_POSIX_UNISTD_H_ */
confstr.h
fs.h
ssize_t
__SIZE_TYPE__ ssize_t
Definition
types.h:28
off_t
__INTPTR_TYPE__ off_t
Definition
types.h:36
mode_t
unsigned int mode_t
Definition
types.h:14
posix_features.h
pid_t
long pid_t
Definition
posix_signal.h:81
posix_types.h
useconds_t
unsigned long useconds_t
Definition
posix_types.h:83
stat.h
stat
int stat(const char *__restrict __path, struct stat *__restrict __sbuf)
mkdir
int mkdir(const char *_path, mode_t __mode)
stat
Definition
stat.h:57
sysconf.h
usleep
int usleep(useconds_t useconds)
sysconf
long sysconf(int opt)
getentropy
int getentropy(void *buffer, size_t length)
sleep
unsigned sleep(unsigned int seconds)
getpid
pid_t getpid(void)
zephyr
posix
unistd.h
Generated on
for Zephyr API by
1.17.0