From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199702231712.LAA04051@atheist.tamu.edu> Date: Sun, 23 Feb 1997 11:12:27 -0600 (CST) From: Richard Henderson Subject: Re: A problem porting sbrk In-Reply-To: <199702230245.UAA27778@atheist.tamu.edu> Would the person having the sbrk problem try this out? I think this will be close enough to satisfy both OSF and current Linux libc. Unfortunately, coming to exact sync with OSF would mean changing libc. Trivially, but still it would have to be propogated. r~ --- arch/alpha/kernel/entry.S.orig Sun Feb 23 10:21:52 1997 +++ arch/alpha/kernel/entry.S Sun Feb 23 10:22:09 1997 @@ -709,7 +709,7 @@ sys_call_table: /*0*/ .quad do_entSys, sys_exit, sys_fork, sys_read, sys_write .quad do_entSys, sys_close, sys_wait4, do_entSys, sys_link .quad sys_unlink, do_entSys, sys_chdir, sys_fchdir, sys_mknod - .quad sys_chmod, sys_chown, sys_brk, do_entSys, sys_lseek + .quad sys_chmod, sys_chown, osf_brk, do_entSys, sys_lseek .quad sys_getxpid, osf_mount, osf_umount, sys_setuid, sys_getxuid .quad do_entSys, sys_ptrace, do_entSys, do_entSys, do_entSys .quad do_entSys, do_entSys, do_entSys, sys_access, do_entSys --- arch/alpha/kernel/osf_sys.c.orig Sun Feb 23 10:15:23 1997 +++ arch/alpha/kernel/osf_sys.c Sun Feb 23 10:29:55 1997 @@ -50,6 +50,20 @@ extern asmlinkage int sys_swapon(const c extern asmlinkage unsigned long sys_brk(unsigned long); /* + * Brk needs to return an error. Still support Linux's brk(0) query idiom, + * which OSF programs just shouldn't be doing. We're still not quite + * identical to OSF as we don't return 0 on success, but doing otherwise + * would require changes to libc. Hopefully this is good enough. + */ +asmlinkage unsigned long osf_brk(unsigned long brk) +{ + unsigned long retval = sys_brk(brk); + if (brk && brk != retval) + retval = -ENOMEM; + return retval; +} + +/* * This is pure guess-work.. */ asmlinkage int osf_set_program_attributes( -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com