You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/09/19 03:07:39 UTC
[incubator-nuttx] branch master updated (9241725 -> e0aa7c6)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.
from 9241725 fs/munmap: export the symbols to avoid build break on C++ syntax
new bf8446e sched/task: Implement gettid(2) syscall
new e0aa7c6 syscall: update syscall_lookup.h with gettid to fix build break
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
include/sys/syscall_lookup.h | 1 +
include/unistd.h | 1 +
sched/task/Make.defs | 2 +-
.../lib_duplocale.c => sched/task/task_gettid.c | 24 ++++++++++++----------
syscall/syscall.csv | 1 +
5 files changed, 17 insertions(+), 12 deletions(-)
copy libs/libc/locale/lib_duplocale.c => sched/task/task_gettid.c (83%)
[incubator-nuttx] 02/02: syscall: update syscall_lookup.h with
gettid to fix build break
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit e0aa7c6d811c084760806dbc8a7e5b7ce811e000
Author: liuhaitao <li...@xiaomi.com>
AuthorDate: Tue Sep 15 12:11:56 2020 +0800
syscall: update syscall_lookup.h with gettid to fix build break
proxies/PROXY_gettid.c: In function 'gettid':
proxies/PROXY_gettid.c:12:41: error: 'SYS_gettid' undeclared (first use in this function); did you mean 'SYS_getpid'?
12 | return (pid_t)sys_call0((unsigned int)SYS_gettid);
| ^~~~~~~~~~
| SYS_getpid
proxies/PROXY_gettid.c:12:41: note: each undeclared identifier is reported only once for each function it appears in
proxies/PROXY_gettid.c:13:1: warning: control reaches end of non-void function [-Wreturn-type]
13 | }
| ^
CC: proxies/PROXY_mmap.c
Makefile:83: recipe for target 'PROXY_gettid.o' failed
Signed-off-by: liuhaitao <li...@xiaomi.com>
Change-Id: Ib4d6e315aa7f17235292dd2d6550458a53bc1596
---
include/sys/syscall_lookup.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h
index 8b1e1b3..279671d 100644
--- a/include/sys/syscall_lookup.h
+++ b/include/sys/syscall_lookup.h
@@ -27,6 +27,7 @@
SYSCALL_LOOKUP1(_exit, 1)
SYSCALL_LOOKUP(exit, 1)
SYSCALL_LOOKUP(getpid, 0)
+SYSCALL_LOOKUP(gettid, 0)
SYSCALL_LOOKUP(sched_getparam, 2)
SYSCALL_LOOKUP(sched_getscheduler, 1)
[incubator-nuttx] 01/02: sched/task: Implement gettid(2) syscall
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit bf8446e235c8767f2da656ae2d0490d58f294d4e
Author: chao.an <an...@xiaomi.com>
AuthorDate: Mon Sep 14 19:57:24 2020 +0800
sched/task: Implement gettid(2) syscall
See the reference here:
https://man7.org/linux/man-pages/man2/gettid.2.html
Change-Id: Ia814d0ccc3b20d8dfc36c809682ddf6e21811d20
Signed-off-by: chao.an <an...@xiaomi.com>
---
include/unistd.h | 1 +
sched/task/Make.defs | 2 +-
sched/task/task_gettid.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
syscall/syscall.csv | 1 +
4 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/include/unistd.h b/include/unistd.h
index afb14f2..51ce8f0 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -308,6 +308,7 @@ EXTERN int optopt; /* Unrecognized option character */
pid_t vfork(void);
pid_t getpid(void);
+pid_t gettid(void);
void _exit(int status) noreturn_function;
unsigned int sleep(unsigned int seconds);
int usleep(useconds_t usec);
diff --git a/sched/task/Make.defs b/sched/task/Make.defs
index 1fa00c7..46dc859 100644
--- a/sched/task/Make.defs
+++ b/sched/task/Make.defs
@@ -37,7 +37,7 @@ CSRCS += task_create.c task_init.c task_setup.c task_activate.c
CSRCS += task_start.c task_delete.c task_exit.c task_exithook.c
CSRCS += task_getgroup.c task_getpid.c task_prctl.c task_recover.c
CSRCS += task_restart.c task_spawnparms.c task_setcancelstate.c
-CSRCS += task_cancelpt.c task_terminate.c exit.c
+CSRCS += task_cancelpt.c task_terminate.c task_gettid.c exit.c
ifeq ($(CONFIG_ARCH_HAVE_VFORK),y)
ifeq ($(CONFIG_SCHED_WAITPID),y)
diff --git a/sched/task/task_gettid.c b/sched/task/task_gettid.c
new file mode 100644
index 0000000..50ff087
--- /dev/null
+++ b/sched/task/task_gettid.c
@@ -0,0 +1,49 @@
+/****************************************************************************
+ * sched/task/task_gettid.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <sys/types.h>
+#include <unistd.h>
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: gettid
+ *
+ * Description:
+ * Get the thread ID of the currently executing thread.
+ *
+ * Input parameters:
+ * None
+ *
+ * Returned Value:
+ * On success, returns the thread ID of the calling process.
+ *
+ ****************************************************************************/
+
+pid_t gettid(void)
+{
+ return getpid();
+}
diff --git a/syscall/syscall.csv b/syscall/syscall.csv
index ca91a51..ac544aa 100644
--- a/syscall/syscall.csv
+++ b/syscall/syscall.csv
@@ -35,6 +35,7 @@
"getitimer","sys/time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","int","FAR struct itimerval *"
"getpeername","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *"
"getpid","unistd.h","","pid_t"
+"gettid","unistd.h","","pid_t"
"getrandom","sys/random.h","defined(CONFIG_CRYPTO_RANDOM_POOL)","void","FAR void *","size_t"
"getsockname","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *"
"getsockopt","sys/socket.h","defined(CONFIG_NET)","int","int","int","int","FAR void *","FAR socklen_t *"