From: Richard Henderson <richard@atheist.tamu.edu>
Subject: Re: A problem porting sbrk
Date: Sun, 23 Feb 1997 11:12:27 -0600 (CST) [thread overview]
Message-ID: <199702231712.LAA04051@atheist.tamu.edu> (raw)
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
next parent reply other threads:[~1997-02-23 17:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199702230245.UAA27778@atheist.tamu.edu>
1997-02-23 17:12 ` Richard Henderson [this message]
1997-02-24 19:38 A problem porting sbrk Steven White
[not found] <199702232301.PAA30446@hedrock.ps.uci.edu>
1997-02-24 17:29 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
1997-02-23 23:01 Steven White
1997-02-22 2:01 Steven White
1997-02-23 2:45 ` Richard Henderson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox