The "reboot" function fails on Linux/Alpha.  The problem is due to type
promotion rules.  The constant 0xfee1dead exceeds the range for (int), and
is promoted to (unsigned int).  The INLINE_SYSCALL passes (long), so the
value is zero-extended to 64 bits and passed in a register.  The kernel
code specifies (int), and expects sign-extension to 64 bits.  The magic
match fails.  The following corrects this for me.  (I think that the large
constants for the "howto" parameter are handled by the prototype, although
I haven't checked for this.)

============================================================================
--- glibc-2.0.112/sysdeps/unix/sysv/linux/reboot.c.orig Tue Oct 20 11:10:57 1998
+++ glibc-2.0.112/sysdeps/unix/sysv/linux/reboot.c      Sat Jan 30 19:00:50 1999
@@ -28,5 +28,5 @@
 int
 reboot (int howto)
 {
-  return INLINE_SYSCALL (reboot, 3, 0xfee1dead, 672274793, howto);
+  return INLINE_SYSCALL (reboot, 3, (int)0xfee1dead, 672274793, howto);
 }
============================================================================

-- 
B. D. Elliott   [EMAIL PROTECTED]   (Seattle)

Reply via email to