Xiang Xiao
125d090b9c
fs: Map madvice to posix_madvice
...
https://man7.org/linux/man-pages/man2/madvise.2.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-20 11:38:41 +02:00
Jukka Laitinen
b09581f736
Add shm_open and shm_unlink to syscalls
...
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-18 11:01:20 +08:00
Xiang Xiao
0a95c7721b
vfs/poll: Remove POLLFILE and POLLSOCK NuttX specific extension
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-17 14:02:59 +08:00
Xiang Xiao
32d0c2ce9d
libc: Add sys/endian.h to improve the compatiblity with bionic libc
...
and move the definition from endian.h to sys/endian.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-15 12:26:15 -03:00
Xiang Xiao
695f42f8d2
net: Move accept to libc after https://github.com/apache/nuttx/pull/8083
...
since accept can simply forward to kernel accept4 function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-13 11:23:42 +02:00
zhanghongyu
48c9d10336
net_socket: add accept4 function
...
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-01-11 23:28:08 +08:00
Jukka Laitinen
0a885da434
syscall: Always add munmap into syscalls
...
Munmap interface is always enabled just like mmap is
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-11 03:11:11 +08:00
Xiang Xiao
b7febf4e19
libc: Move tree.h from include/nuttx to include/sys
...
to match freebsd layout
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-03 10:34:57 +02:00
dongjiuzhu1
5d643b3bef
sys/socket/scm: return NULL when cmsg_len is zero
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-29 13:25:24 +08:00
dongjiuzhu1
f85d9a9332
fs/signalfd: using file descriptor to accept signal
...
Reference here:
https://man7.org/linux/man-pages/man2/signalfd.2.html
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-28 23:05:58 +08:00
Ville Juven
2ed51d026c
fs/streams: Move the file streams from the group structure into TLS
...
This is preparation for flushing streams from user space, like it should
be done.
- Move tg_streamlist (group, kernel space) ->
ta_streamlist (TLS, user space)
- Access stream list via tg_info in kernel
- Access stream list via TLS in user space
- Remove / rename nxsched_get_streams -> lib_getstreams
- Remove system call for nxsched_get_streams
2022-12-22 20:16:11 +08:00
田昕
2719869ab2
Move _assert to kernel space.
...
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-12-06 18:33:21 +08:00
Peter Bee
c26fd6565d
drivers/video: enhance v4l2 compatibility
...
Add common BSD v4l2 header file
Complete ioctls according to standard v4l2 drivers
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-03 02:48:01 +08:00
dongjiuzhu1
ccf0c3566e
net/local: support cmd SO_PEERCRED
...
the credentials of the peer process connected to this socket.
refs:https://man7.org/linux/man-pages/man7/unix.7.html
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-11-23 15:01:54 +08:00
wangbowen6
25bfd437fe
fs_epoll: support extend the epoll dynamicly.
...
1. epoll_ctl(EPOLL_CTL_ADD) support extend the epoll
events dynamicly;
2. enhance the epoll performance by moving some poll setup
and teardown process to the EPOLL_CTL_ADD/DEL/MOD;
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-22 21:08:56 +08:00
Andrés Sánchez Pascual
9f029194e1
sys: boardctl: Add more reset causes to enum
...
Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
2022-11-13 21:26:31 -03:00
Michael Jung
b401db5ca4
prctl syscall is present unconditionally
...
I had a link problem regarding prctl while CONFIG_TASK_NAME_SIZE was
defined 0 and building in protected mode. Turns out in monolithic
build prctl is present no matter what CONFIG_TASK_NAME_SIZE, but in
protected mode build its only present if CONFIG_TASK_NAME_SIZE > 0.
So, bring protected mode build in sync with the monolithic one.
Signed-off-by: Michael Jung <michael.jung@secore.ly>
2022-11-09 01:21:16 +08:00
Xiang Xiao
19bded4738
fs: Remove the unused nx_pipe to prefer file_pipe for kernel
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Petro Karashchenko
2fd7e18a16
include/sys: fix style issues in queue.h
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-24 12:59:24 +08:00
chao an
205c8934a3
sched/msgq: add support of System V message queue
...
https://man.openbsd.org/msgget.2
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-22 12:58:11 +08:00
Xiang Xiao
6b31918b42
Remove the unnecessary cast for main_t, NULL and argv
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 08:51:45 +02:00
Xiang Xiao
78f6a02bc8
boards: Remove the duplicated prototype of CONFIG_INIT_ENTRYPOINT
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:02:44 +02:00
wangbowen6
e9ccab2db3
fs/poll: using callback mechanism to implement poll notification
...
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-10-03 00:00:56 +08:00
wangbowen6
344c8be049
poll: add poll_notify() api and call it in all drivers
...
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-26 12:06:32 +08:00
chao.an
9cb17841d8
net/sockopt: move BINDTODEVICE to socket level
...
rename the UDP_BINDTODEVICE to SO_BINDTODEVICE to follow the linux
style to be compatible with non-UDP protocol binding requirements
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-25 17:56:52 +08:00
Duane Skelton
df4b8adacf
Added extern C {} wrapper consistent with other headers in include/sys
2022-08-16 12:04:01 +08:00
anjiahao
beb9144141
include:add sys/queue.h support form openbsd
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-08-16 12:03:45 +08:00
Jiuzhu Dong
aeec797511
syscall: remove directory syscall
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-10 13:33:08 +08:00
Xiang Xiao
fa2e1897ea
libc: Implement memfd on top of tmpfs
...
https://man7.org/linux/man-pages/man2/memfd_create.2.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-09 22:13:09 +03:00
Jiuzhu Dong
978530f5f6
fs/ioctl: add BLKSSZGET cmd to get block sector size
...
refer to:
https://sites.uclouvain.be/SystInfo/usr/include/sys/mount.h.html
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-22 09:07:57 +03:00
Jiuzhu Dong
008cb0d31a
sys/sysmacros.h: support sysmacros header
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-22 11:10:08 +08:00
anjiahao
2b65b46946
boardctl:add reset subreason restore factory
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-07-21 20:48:56 +08:00
Masayuki Ishikawa
d96c87f666
syscall: Add socketpair to syscall.csv
...
Summary:
- This commit adds socketpair to syscall.csv
Impact:
- None
Testing:
- Tested with adb (not merged net)
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-07-15 13:31:58 +08:00
Ville Juven
ba4277bb13
syscall: Remove exit() call gate
...
exit() is a userspace function, no need for call gate
2022-06-20 14:14:28 +03:00
Juha Niskanen
449cf4d076
getrandom: fix comment contradicting code
...
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2022-06-15 11:18:04 -03:00
chao.an
644283c8ff
libc/ipc: add ftok(3) support
...
https://man.openbsd.org/ftok.3
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-09 18:19:48 +03:00
chao.an
795884dbf1
sys/ipc: correct definition value of IPC_*
...
the definition of MSG_NOERROR and IPC_NOWAIT should not be aligned
------------------------------------------------------------------
MSGOP(2)
NAME
msgrcv, msgsnd - System V message queue operations
...
EXAMPLE
The program below demonstrates the use of msgsnd() and msgrcv().
...
if (msgrcv(qid, (void *) &msg, sizeof(msg.mtext), msgtype,
MSG_NOERROR | IPC_NOWAIT) == -1) {
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-09 18:19:48 +03:00
Xiang Xiao
f1236da21c
fs: Make the binary(no process) mode as the default
...
POSIX require file system shouldn't enable the \r and \n conversion by default
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-07 20:22:26 +03:00
Ville Juven
a54c3d13f9
sched: Remove SCHED_ATEXIT / SCHED_ONEXIT
...
Remove the kernel side implementations altogether. These will be
replaced by user land implementations.
2022-05-25 15:28:43 +08:00
Ville Juven
5bcd1dbb64
sched: Remove task_restart in case of CONFIG_BUILD_KERNEL
...
Same treatment as task_delete, this is not usable in kernel build
either.
2022-05-12 22:08:19 +08:00
Ville Juven
b1d92159fa
sched: Remove task_delete in case of CONFIG_BUILD_KERNEL
...
Deleting a task from another task's context will not do, so shut
this gate down for BUILD_KERNEL. In this case if a task wants another
task to terminate, it must ask the other task to politely kill itself.
Note: kthreads still need this, also, the kernel can delete a task
without asking.
2022-05-12 03:27:25 +08:00
YAMAMOTO Takashi
ded4fd33c1
Implement preadv and pwritev
2022-04-28 13:40:25 +08:00
Xiang Xiao
55b5561fdb
sched/task: Implement execle and execve
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-22 10:40:31 +03:00
Ville Juven
d6ef4849a9
syscall: Add call gate for get_environ_ptr
...
Now that the environment strings are stored as an array of strings,
they can be passed from the application via char **environ, which
is really defined as a function call to get_environ_ptr().
This works as is for flat build, but protected mode and kernel mode
require a call gate, which is added here.
2022-04-21 18:38:37 +08:00
Jiuzhu Dong
d535943a69
fs/epoll: change type of eventset from uint8_t to uint32_t
...
to support EPOLLONESHOT and so on.
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-07 12:14:06 +08:00
田昕
4071f460b2
boards/boardctl:common boardctl to read reset cause.
...
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-03-30 09:59:10 +03:00
Xiang Xiao
c8ea7a95a3
libc: Implement getrandom on top of "/dev/[u]random"
...
https://man7.org/linux/man-pages/man2/getrandom.2.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-25 13:48:33 +02:00
Xiang Xiao
0f2f48f8ba
sys/type.h: Change pid_t from int16_t to int
...
to fix the following warning:
include/unistd.h:302:9: error: incompatible redeclaration of library function 'vfork' [-Werror,-Wincompatible-library-redeclaration]
pid_t vfork(void);
^
include/unistd.h:302:9: note: 'vfork' is a builtin with type 'int (void)'
and change 32768 to INT_MAX to match the type change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-21 15:48:33 +02:00
chao.an
ea42981cc6
syscall/names: export the syscall name in STUB module
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-03-14 21:37:53 +02:00
Xiang Xiao
44bd3212d4
arch: Remove SYS_RESERVED from Kconfg
...
let's arch define the correct value instead
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-27 22:54:13 +08:00