2.6.23 alpha unistd.h changes

Oliver Falk
2007-09-17T20:37:09Z

[-- Attachment #1: Type: text/plain, Size: 1432 bytes --]

Hi!

At Alphacore we used to patch the kernel headers for a while now; We
added syscalls __NR_openat (447) until __NR_tee (466).

However, since 2.6.23 these syscall where added upstream, but with
different syscall numbers; What happens is the following:

* glibc 2.6.90 compiled with 2.6.23 headers installed
* kernel 2.6.21 (our patched headers in place, different syscall
'ordering'/numbers) installed

[root@tyskie ~]# uname -r; touch x; rm -f x
2.6.23-0.145.rc4.fc8
rm: cannot remove `x': File exists

:-( I don't want to live without rm :-P and chmod doesn't work as well...

If I start 2.6.15, where these syscalls where not in place, it works
just fine. If I install old glibc 2.6 (compiled against 2.6.21 headers)
and kernel 2.6.21 also everything is fine.

Final test was now:
* Boot kernel 2.6.23 and glibc 2.6.90 (compiled against 2.6.23 headers),
also everything seems to work.

As these additions are quite new to upstream kernel, but at Alphacore we
have patched it since a while now (I don't know about other Alpha ports;
Debian folks may speak up now!), I would suggest to use the same
'ordering' of the syscalls upstream and add the new syscalls that we had
not in place, but are now upstream to the end of our 'old' list.

I have attached our patch that we used for 2.6.21.

Please let me know if that's fine everyone and keep me posted directly
and only via m/l, as I might miss the mail then...

Best,
Oliver

[-- Attachment #2: linux-2.6.21-alpha_missing_syscalls.patch --]
[-- Type: application/octet-stream, Size: 2000 bytes --]

--- linux-2.6.21/include/asm-alpha/unistd.h.missing_defines 2007-05-16 10:53:02.000000000 +0200
+++ linux-2.6.21/include/asm-alpha/unistd.h 2007-05-16 10:54:44.000000000 +0200
@@ -388,9 +388,30 @@
#define __NR_inotify_add_watch 445
#define __NR_inotify_rm_watch 446

+#define __NR_openat 447
+#define __NR_mkdirat 448
+#define __NR_mknodat 449
+#define __NR_fchownat 450
+#define __NR_futimesat 451
+#define __NR_unlinkat 452
+#define __NR_renameat 453
+#define __NR_linkat 454
+#define __NR_symlinkat 455
+#define __NR_readlinkat 456
+#define __NR_fchmodat 457
+#define __NR_faccessat 458
+#define __NR_pselect6 459
+#define __NR_ppoll 460
+#define __NR_unshare 461
+#define __NR_set_robust_list 462
+#define __NR_get_robust_list 463
+#define __NR_splice 464
+#define __NR_sync_file_range 465
+#define __NR_tee 466
+
#ifdef __KERNEL__

-#define NR_SYSCALLS 447
+#define NR_SYSCALLS 467

#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
--- linux-2.6.21/arch/alpha/kernel/systbls.S.missing_defines 2007-05-16 11:32:29.000000000 +0200
+++ linux-2.6.21/arch/alpha/kernel/systbls.S 2007-05-16 11:30:36.000000000 +0200
@@ -465,6 +465,26 @@
.quad sys_inotify_init
.quad sys_inotify_add_watch /* 445 */
.quad sys_inotify_rm_watch
+ .quad sys_openat
+ .quad sys_mkdirat
+ .quad sys_mknodat
+ .quad sys_fchownat /* 450 */
+ .quad sys_futimesat
+ .quad sys_unlinkat
+ .quad sys_renameat
+ .quad sys_linkat
+ .quad sys_symlinkat /* 455 */
+ .quad sys_readlinkat
+ .quad sys_fchmodat
+ .quad sys_faccessat
+ .quad sys_pselect6
+ .quad sys_ppoll /* 460 */
+ .quad sys_unshare
+ .quad sys_set_robust_list
+ .quad sys_get_robust_list
+ .quad sys_splice
+ .quad sys_sync_file_range
+ .quad sys_tee

.size sys_call_table, . - sys_call_table
.type sys_call_table, @object