LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-29-2009, 08:13 AM   #1
shayke23
LQ Newbie
 
Registered: Apr 2009
Posts: 8

Rep: Reputation: 0
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

Last edited by shayke23; 04-29-2009 at 08:18 AM.
 
Old 04-30-2009, 12:48 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

Where/how is buf defined?



Cheers,
Tink
 
Old 05-02-2009, 05:04 AM   #3
shayke23
LQ Newbie
 
Registered: Apr 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add path to $PATH variable alaios SUSE / openSUSE 2 04-19-2009 09:41 AM
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 06:48 PM
PATH variable suavecu Linux - Software 11 01-28-2006 01:44 AM
$path variable ? moby Linux - Newbie 3 06-01-2004 04:18 PM
the path variable mjkramer Linux - Newbie 4 10-18-2003 08:18 AM


All times are GMT -5. The time now is 06:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration