Bad interaction between mmap and busy text files.

bugs at shire.cs.psu.edu bugs at shire.cs.psu.edu
Sun Aug 20 12:17:53 AEST 1989


Serial Number:  922E0914
Machine Type:   Sun 4/280
O/S Version:    SunOS 4.0.3
Organization:   Computer Science Department, The Pennsylvania State University
                333 Whitmore Laboratory, University Park, PA   16802
Phone Number:   +1 814 865 9723

Description:
	In pure 4.3BSD when an executable is being executed (and paged
	out of) the kernel refuses to allow it to be overwritten,
	returning instead the error ETXTBSY ("text file busy").  In SunOS,
	programs like "cp" use mmap, which succedes in overwriting the
	busy text file, usually aborting the executing instance of the
	first program.  My intuition is that mmap should return ETXTBSY
	in this case instead.

Repeat-By:
	Run a program in the background, and then copy something else 
	on top of it with "cp".

	I only tried this with local disks.  Who knows what NFS will do?

-- Scott Schwartz	<schwartz at shire.cs.psu.edu>



More information about the Comp.sys.sun mailing list