[PATCH] pthreads: expose pthread_attr_getscope() symbol properly

9 views
Skip to first unread message

Waldemar Kozaczuk

unread,
Jun 12, 2020, 5:28:55 PM6/12/20
to osv...@googlegroups.com, Waldemar Kozaczuk
The pthread_attr_getscope signature in pthread.cc does not match
its declaration as a C function in include/api/pthread.h header
and causes it to be exported as C++ symbol:

```C
pthread_attr_getscope(pthread_attr_t*, int*)
```

This patch adjusts the signature in the definition to match
the declaration to export the symbol properly:

```C
pthread_attr_getscope
```

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>
---
libc/pthread.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/pthread.cc b/libc/pthread.cc
index 2f0afb7f..60158b31 100644
--- a/libc/pthread.cc
+++ b/libc/pthread.cc
@@ -730,7 +730,7 @@ int pthread_attr_setscope(pthread_attr_t *attr, int scope)
return 0;
}

-int pthread_attr_getscope(pthread_attr_t *attr, int *scope)
+int pthread_attr_getscope(const pthread_attr_t *__restrict attr, int *scope)
{
*scope = PTHREAD_SCOPE_SYSTEM;
return 0;
--
2.25.1

Commit Bot

unread,
Jun 14, 2020, 6:17:52 PM6/14/20
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

pthreads: expose pthread_attr_getscope() symbol properly

The pthread_attr_getscope signature in pthread.cc does not match
its declaration as a C function in include/api/pthread.h header
and causes it to be exported as C++ symbol:

```C
pthread_attr_getscope(pthread_attr_t*, int*)
```

This patch adjusts the signature in the definition to match
the declaration to export the symbol properly:

```C
pthread_attr_getscope
```

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
diff --git a/libc/pthread.cc b/libc/pthread.cc
Reply all
Reply to author
Forward
0 new messages