Article View: comp.unix.programmer
Article #3637Re: Problem using fork, shared memory
From: Henk Borsje
Date: Tue, 03 Feb 1998 00:00
Date: Tue, 03 Feb 1998 00:00
14 lines
1745 bytes
1745 bytes
Hello folks, The man pages are clear about what 'fork' inherits. It does include attached shared memory sections. So just make sure you create your shared memory before you fork, and all pointers will be correct. FWIW: A general comment about pointers stored in shared memory. I found it the easiest to express the pointers as an offset to the begin address of the global section. When you need to access the data that your pointer is pointing to, all that needs to be done is add the address of the global section in the application to this pointer. This will make your final addresss calculation the same in all your components that use the shared memory.
Technical Details
Message-ID:
<6b76am$7tj$2@decius.ultra.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34C9045E.1C95@airone.claircom.com> <34C93501.47C@airone.claircom.com> <6abf4q$4np@camel12.mindspring.com> <34CBD718.4FB7@airone.claircom.com> <885913234snz@genesis.demon.co.uk> <34CE9074.6262@airone.claircom.com> <6b5rhf$75g@camel20.mindspring.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,e74399effbe2897f X-Google-Attributes: gid11318c,public X-Google-Thread: fc89c,e74399effbe2897f X-Google-Attributes: gidfc89c,public X-Google-Thread: 11035d,8f3351c6e065c62a X-Google-Attributes: gid11035d,public From: Henk Borsje <Henk@*NOSPAM*alert-systems.com> Subject: Re: Problem using fork, shared memory Date: 1998/02/03 Message-ID: <6b76am$7tj$2@decius.ultra.net> X-Deja-AN: 321666478 Content-Transfer-Encoding: 7bit References: <34C9045E.1C95@airone.claircom.com> <34C93501.47C@airone.claircom.com> <6abf4q$4np@camel12.mindspring.com> <34CBD718.4FB7@airone.claircom.com> <885913234snz@genesis.demon.co.uk> <34CE9074.6262@airone.claircom.com> <6b5rhf$75g@camel20.mindspring.com> X-Ultra-Time: 3 Feb 1998 13:33:10 GMT Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@ultra.net Organization: Alert Systems Inc. Mime-Version: 1.0 Reply-To: returnmail@*NOSPAM*alert-systems.com Newsgroups: comp.unix.programmer,comp.unix.solaris,comp.unix.programmer,gnu.gcc.help