LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problems with path variable ( i think) (https://www.linuxquestions.org/questions/linux-newbie-8/problems-with-path-variable-i-think-722461/)

shayke23 04-29-2009 07:13 AM

problems with path variable ( i think)
 
hi,
i have written a program in C, which runs perfect under Kubuntu on my PC.
this program is a uni assignment, so i tried to run it under the uni Planet server, but then i encounter some difficulties...

the assignment is about writing new wrapper function instead of open and read syscalls.
so when i write:
int fd=wrapper_open("config.txt",O_RDONLY,S_IRWXO);
and,while ((read = wrapper_read(fd,buf,1000)) > 0 )
{
...
}
under my Kubuntu works perfect.

but then under Planet it exists on errno:
EFAULT - buf is outside your accessible address space.

i guess its about the variable path.
is it?

p.s. config.txt is a file i wroted and i have the right permissions to read.
PATH is : [ /u/y2006/navehs/bin:/usr/local/bin:/Common/All/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/java/default/bin:/u/y2006/navehs/bin:. ]
under Planet server

Tinkster 04-29-2009 11:48 PM

Hi, welcome to LQ!

Where/how is buf defined?



Cheers,
Tink

shayke23 05-02-2009 04:04 AM

Quote:

Originally Posted by Tinkster (Post 3525397)
Hi, welcome to LQ!

Where/how is buf defined?



Cheers,
Tink

well, it was defined by a local array, but then i changed it to a pointer, and it worked perfect.

thx!


All times are GMT -5. The time now is 10:33 PM.