LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2008, 11:59 PM   #1
sunnior
Member
 
Registered: Feb 2008
Distribution: ubuntu
Posts: 43

Rep: Reputation: 15
Smile ": Invalid argument" ": success" who said???


hello, everyone. I has finished a small program. When I run it in a shell, I got some information, which I hadn't expected. for example, I run my program with some invalid argument to cause it return -1, then I see the information which I use the "perror" function to print. But they are followed by other information such as ": invalid argument" or ": success". These kind of sentence never appear in my code.
Who said these? I am totally confused. Please help me.

some functions used in my code:
#include <time.h>
#include <signal.h>

timer_create(...);
timer_settime(...);

sorry for my bad English.

Last edited by sunnior; 04-03-2008 at 11:52 PM.
 
Old 04-01-2008, 12:54 AM   #2
fietze
LQ Newbie
 
Registered: Jun 2004
Location: Germany
Distribution: OpenSUSE 10.3 i586, Debian 3.1 i586, Debian Unstable PPC
Posts: 12

Rep: Reputation: 0
Quote:
Originally Posted by sunnior View Post
...
But they are followed by other information such as ": invalid argument" or ": success".
Ever tried to call "man 3 perror"? It is the textual description of the error in errno.
 
Old 04-01-2008, 10:58 AM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
2 gentle suggestions -- if this is a C program,
  • Put "C program" in the title.
  • Post your Q in the Programming sub-forum.
 
Old 04-02-2008, 08:11 AM   #4
sunnior
Member
 
Registered: Feb 2008
Distribution: ubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
Smile

Quote:
Originally Posted by archtoad6 View Post
2 gentle suggestions -- if this is a C program,
  • Put "C program" in the title.
  • Post your Q in the Programming sub-forum.
Thanks for your kind suggestions.
As a newbie, there is really much for me to learn.
 
Old 04-02-2008, 09:39 AM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
I just realized no one said anything in your 1st thread, so: Welcome to LQ !

You're welcome, thanks for listening.

BTW, you can implement both suggestions as follows:

1. I believe you can edit the title as well as the body of the post. While that won't change what has already appeared in the daily "LinuxQuestions.org Zero Reply Threads" e-mail, it should appear w/ the new title everywhere else.

2. You are allowed & encouraged to report your own post to the Mods. to ask to have it moved to a more appropriate forum.
 
Old 04-06-2008, 12:18 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <Programming> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 05-12-2008, 09:38 AM   #7
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Did you ever get an answer?

Did you solve it on your own?
 
Old 05-13-2008, 10:58 PM   #8
sunnior
Member
 
Registered: Feb 2008
Distribution: ubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
Smile

Quote:
Originally Posted by archtoad6 View Post
Did you ever get an answer?

Did you solve it on your own?
Yes, I solved it on my own, as soon as I knew it had something to
do with the perror function.
 
Old 05-14-2008, 07:00 AM   #9
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Thumbs up

Good for you.

Could you post the details for others who might have the same problem?
 
Old 05-15-2008, 09:52 AM   #10
sunnior
Member
 
Registered: Feb 2008
Distribution: ubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
Smile


Thank you for the suggestion.
Here it is:

I tried the command "man 3 perror" and got the following message:
Quote:
DESCRIPTION
The routine perror() produces a message on the standard error output,
describing the last error encountered during a call to a system or
library function. First (if s is not NULL and *s is not a null byte
(’\0’)) the argument string s is printed, followed by a colon and a
blank. Then the message and a new-line.
That' the final reason.
 
  


Reply



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
error: Error for wireless request "Set Mode" (8B06) : invalid argument "roaming" penguin chick Linux - Wireless Networking 5 08-22-2008 01:16 PM
Enemy Territory no sound "GETOSPACE: Invalid argument" kronesr Linux - Games 1 12-29-2007 10:14 PM
Unable to "scanimage": "invalid argument” in Debian 4.0 sonichedgehog Linux - Newbie 3 12-02-2007 02:31 PM
alsa mixer sayin "function snd_mixer_load failed:invalid argument" callmeleroi Fedora 0 03-11-2007 09:05 AM
"cp -p" fails with "cp: setting permissions for `/home/svbld/t': Invalid argument" mkhesin Red Hat 1 02-28-2007 12:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:40 PM.

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
Open Source Consulting | Domain Registration