Skip to content

Commit a42746b

Browse files
committed
Fixed implicit declaration of GNU extension gettid
Fixes current compilation error (found on Ubuntu 24): ``` 23:16:48 log.c:637:21: error: implicit declaration of function 'gettid'; did you mean 'getgid'? [-Wimplicit-function-declaration] 23:16:48 637 | pid_t tid = gettid(); 23:16:48 | ^~~~~~ 23:16:48 | getgid ``` Ticket: ENT-13084 Signed-off-by: Lars Erik Wik <[email protected]>
1 parent a442557 commit a42746b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

deps-packaging/apache/debian/rules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ build-stamp:
1414
dh_testdir
1515

1616
patch -p0 < $(CURDIR)/apachectl.patch
17+
18+
# Fixed implicit declaration of GNU extension gettid() (See ENT-13084)
19+
patch -p1 < $(CURDIR)/fixed-implicit-decl-gettid.patch
20+
1721
./configure \
1822
--prefix=$(PREFIX)/httpd \
1923
--enable-so \
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff -ruN httpd-2.4.63/server/log.c httpd-2.4.63-modified/server/log.c
2+
--- httpd-2.4.63/server/log.c 2024-06-21 16:31:54.000000000 +0200
3+
+++ httpd-2.4.63-modified/server/log.c 2025-06-26 15:58:03.168415807 +0200
4+
@@ -633,11 +633,11 @@
5+
#endif
6+
#if defined(HAVE_GETTID) || defined(HAVE_SYS_GETTID)
7+
if (arg && *arg == 'g') {
8+
-#ifdef HAVE_GETTID
9+
- pid_t tid = gettid();
10+
-#else
11+
+// #ifdef HAVE_GETTID
12+
+// pid_t tid = gettid();
13+
+// #else
14+
pid_t tid = syscall(SYS_gettid);
15+
-#endif
16+
+// #endif
17+
if (tid == -1)
18+
return 0;
19+
return apr_snprintf(buf, buflen, "%"APR_PID_T_FMT, tid);

0 commit comments

Comments
 (0)