The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Wrapping Your Brain Around Oracle + Python iBot Oracle Updates (RSS) 0 04-06-2008 02:10 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #15  
Old 05-10-2007
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
This doesn't work on HP-UX either - as expected, to be honest. Throws the same error.
Reply With Quote
Forum Sponsor
  #16  
Old 05-10-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Quote:
You can run this only once. Tested on Solaris 10
Does that mean tested and worked on Solaris 10 ?
Or I mistook it has worked for tested instead ?
Reply With Quote
  #17  
Old 05-10-2007
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
It worked.
Code:
# cc test.c
# ls -l a.out
-rwxr-xr-x   1 root     other       6988 May 11 13:18 a.out
# ./a.out
Hello, world... for now!
# ls -l a.out
-rwxr-xr-x   1 root     other       6988 May 11 13:18 a.out
# ./a.out
bash: ./a.out: cannot execute binary file
Reply With Quote
  #18  
Old 05-10-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
Quote:
Originally Posted by blowtorch
This is another way of going about it...
OK, If Solaris is allowing that, Solaris is broken. Unlinking an executable is one thing. But opening it for writing?? You've got to be kidding me. The Linux man page for open clearly states that this won't fly in even in Linux. When I saw that Solaris allowed unlinking a busy executable, I thought that the Solaris folks had made a reasoned change in the way things work. Now I see that they just fumbled. Don't write into running executables. A program like that is going to Solaris specific at best. And once Sun notices the problem they will probably fix it.
Reply With Quote
  #19  
Old 05-11-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Quote:
And once Sun notices the problem they will probably fix it.
Do you mean its a possible bug in Solaris allowing to write in a executable that is currently being executed ?

If thats a bug, how would they be notified about the bug ?
Reply With Quote
  #20  
Old 05-11-2007
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,683
Quote:
Originally Posted by matrixmadhan
If thats a bug, how would they be notified about the bug ?
Perhaps http://bugs.opensolaris.org/ ?
Reply With Quote
  #21  
Old 05-11-2007
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
Quote:
Originally Posted by Perderabo
OK, If Solaris is allowing that, Solaris is broken.
Well, it may be broken, but there is a ETXTBSY error documented in the Solaris open(2) manpage, and this is what it says:
Code:
ETXTBSY         The file is a pure procedure  (shared  text)
                     file  that  is  being  executed and oflag is
                     O_WRONLY or O_RDWR.
I don't really understand what a 'pure procedure' means, but it looks like that is the only thing that will fail to open for a write.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0