Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think.com!news From: barmar@think.com (Barry Margolin) Newsgroups: comp.unix.questions Subject: sbrk(2) question Message-ID: <1991Mar8.180132.12025@Think.COM> Date: 8 Mar 91 18:01:32 GMT Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 19 This question came up at work yesterday: when sbrk(2) is used to increase the size of the data segment, is the newly-allocated memory guaranteed to be empty? The man page (on SunOS 4.1.1 and Ultrix 3.x) doesn't say anything about the contents of the new memory. For security reasons it makes sense that data from an old process should not slip into another process's address space, but this is Unix so I don't think such assumptions are always safe :-( Assuming most implementations provide zero-filled memory, is this generally done using some kind of optimization of all-zero memory pages, or does it have to explicitly zero lots of memory and swap space pages (assuming you give sbrk() a large value)? -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar