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
  #22  
Old 05-11-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Quote:
Originally Posted by vino
Cool!

Who is filing it from our forum ?
Reply With Quote
Forum Sponsor
  #23  
Old 05-11-2007
kahuna's Avatar
Registered User
 

Join Date: Apr 2007
Posts: 148
Quote:
Originally Posted by blowtorch
This is another way of going about it:
Code:
        if((write(fd,buf,strlen(buf)))==-1) {
To me, this violates the requirement to "not make use of files or any extrnal means of storing some data."
Reply With Quote
  #24  
Old 05-11-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Sorry, where is other file used or what is the other means of storing the data here.

The file from which it is run therefore in the binary ( exe ) file the buf is written into and what is the other means of storing the data here ?
Reply With Quote
  #25  
Old 05-11-2007
kahuna's Avatar
Registered User
 

Join Date: Apr 2007
Posts: 148
Quote:
Originally Posted by matrixmadhan
Sorry, where is other file used or what is the other means of storing the data here.
The executeable is a file and data ""0000000000" is being stored there.
Reply With Quote
  #26  
Old 05-11-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
Quote:
Originally Posted by blowtorch
Well, it may be broken, but there is a ETXTBSY error documented in the Solaris open(2) manpage, and this is what it says...
Yeah, but it's not enough to put it on the man page. The kernel needs to operate that way. Your program should not have worked on Solaris.
Quote:
Originally Posted by blowtorch
I don't really understand what a 'pure procedure' means,
In the bad old days, a process was a hodge podge of intermingled code and data. There was no distinction between code and data. A program could rewrite itself on the fly and this was thought to be cool. Then the concept of separating code and data arose. The idea was that "code" (instructions) should not be modified while data needed to be modified. A further refinement occurred when folks realized that some data was constant in nature and also should not be modified. Now the non-modifiable part of a process was renamed to "text". The cpu can guarantee that text is not modified. What's more, if two different users run the same program, both processes can use the same text segment. This is "shared text". Then came virtual memory where a very large program can be run in a small amount of physical memory by paging stuff in-to and out-of core as needed. In virtual memory systems, the text segment is read as it is needed.

This is why the Solaris behavior is so very wrong. If you and I run the same program, our processes share the text segment. If you modify your text segment, you modify mine as well. The separation between processes has been lost. Our entire text segment may not be in core. If you modify the program on disk, we may then page in the modifed data. Our shared text segment can now change, undermining the guarantee that the text segment is stable.

matrixmadhan, I meant that Sun themselves might actually notice that their OS now has unstable processes. If not, then someone with a support contract may raise the issue. A non-customer has no standing to demand repairs on an OS. It's hard enough to get stuff fixed when you are a customer (been there, done that). No way am I going to try to get something fixed as a non-customer.
Reply With Quote
  #27  
Old 05-11-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
Quote:
Originally Posted by kahuna
To me, this violates the requirement to "not make use of files or any extrnal means of storing some data."
If we are not allowed to store the output from the compiler into a file, then I will concede defeat. Not only is this challenge impossible, but it is now impossible to run any processes at all.
Reply With Quote
  #28  
Old 05-11-2007
kahuna's Avatar
Registered User
 

Join Date: Apr 2007
Posts: 148
Quote:
Originally Posted by Perderabo
If we are not allowed to store the output from the compiler into a file, then I will concede defeat. Not only is this challenge impossible, but it is now impossible to run any processes at all.
The original challenge clearly allows the program to be compiled. But it does not allow the program itself to use "files". It does not exclude the executeable file from the no use requirement.
Quote:
Write a C program to do a small task(lets say just simply printing a "Hello World" or so) such that the program should only give output or the desired result ony once after it got compiled and should never give the output nor do anything else. The program should not make use of files or any extrnal means of storing some data.
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 07:22 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