Questions tagged [errno]

errno is an integer variable, which is set by system calls and some library functions in the event of an error to indicate what went wrong. Its value is significant only when the return value of the call indicated an error.

errno is an integer variable, which is set by system calls and some library functions in the event of an error to indicate what went wrong. Its value is significant only when the return value of the call indicated an error.

559 questions
6
votes
3 answers

Linux, convert errno to name

I am looking for an API to convert an errno integer to its name. For example: int fd; if((fd = open(path, O_RDONLY)) == -1) printf("error: %d %s %s\n", errno, strerror(errno), ERRNONAME(errno)); So, ERRNONAME would yield a name, such as…
Todd Freed
  • 877
  • 6
  • 19
6
votes
0 answers

pyinstaller can't find pyinstaller.exe

I was having trouble running some code as a .exe file when I used pyinstaller, it wouldn't find the module Crypto even though it successfully turned into a .exe file(I am using pycrypto if that helps) so I changed my imports from from Crypto.Hash…
Some_dude
  • 139
  • 1
  • 8
6
votes
1 answer

Python urlopen connection aborted - urlopen error [Errno 10053]

I have some code that uses mechanize and beautifulsoup for web scraping some data. The code works fine on a test machine but the production machine is blocking the connection. The error i get is: urlopen error [Errno 10053] An established connection…
serk
  • 4,329
  • 2
  • 25
  • 38
6
votes
2 answers

Why errno, when POSIX function indicate error condition by returning -1 or NULL

When an error occurs in one of the UNIX System functions, a negative value is often returned, and the integer errno is set to a value, that gives additional information. -- Advanced Programming in the UNIX Environment, section 1.7 This seems…
Vorac
  • 8,726
  • 11
  • 58
  • 101
6
votes
2 answers

User-defined errno range values (POSIX or Linux-specific)

Questions for POSIX if possible, else for Linux-specific platforms: Is there user-defined errno values? (as for signals SIGUSR1 and SIGUSR2) How to find an errno value not used by the system? (negative values?) How to prevent strerror() break?…
oHo
  • 51,447
  • 27
  • 165
  • 200
6
votes
2 answers

IOError: [Errno 22] invalid mode ('w') or filename

I am getting this error thrown when trying to make a file. It is being designed to take a created .csv file and put it into a plain text file. I would like it to create a new file after it has been run with the date and time stamp but I seem to get…
SergeProtector
  • 113
  • 1
  • 2
  • 6
6
votes
2 answers

when does open(2) fail with errno == EMLINK?

i came across a bit of code which says int fd = open(fn, flags, 0); if (fd < 0 && errno != EMLINK) ... flags is either O_RDONLY or O_RDONLY|O_NOFOLLOW IEEE Std 1003.1, 2013 (SUSv4) has just [EMLINK] Too many links. An attempt was made to have…
just somebody
  • 18,602
  • 6
  • 51
  • 60
6
votes
3 answers

What kind of errors set "errno" to non-zero? Why does fopen() set "errno" while fputc() does not?

What kind of errors faced by what kind of library functions affect the errno and set it to non-zero value? In my following program, I intended to use if(errno!=0) as a condition to check if the library functions I used functioned properly or not,…
Rüppell's Vulture
  • 3,583
  • 7
  • 35
  • 49
6
votes
4 answers

How to detect if errno_t is defined?

I'm compiling code using gcc that comes from Visual C++ 2008. The code is using errno_t, but in some versions of gcc headers including doesn't define the type. How do I detect if the type is defined? Is there a define that signals that the…
vividos
  • 6,468
  • 9
  • 43
  • 53
6
votes
2 answers

In Windows, is there any way to convert an errno into an HRESULT?

I know the HRESULT_FROM_WIN32 macro to convert a Win32 error code into an HRESULT, is there any way to do the conversion starting from an errno error?
Alessandro Jacopson
  • 18,047
  • 15
  • 98
  • 153
5
votes
2 answers

How to get an error message for errno value in python?

I am using the ctypes module to do some ptrace system calls on Linux, which actually works pretty well. But if I get an error I wanna provide some useful information. Therefore I do an get_errno() function call which returns the value of errno, but…
Nicola Coretti
  • 2,655
  • 2
  • 20
  • 22
5
votes
3 answers

errno, strerror and Linux system calls

I can use strerror() to get text representation of errno value after using CRT functions, like fopen(). If I use open() Linux system call instead of CRT function, it also sets errno value when it fails. Is this correct to apply strerror() to this…
Alex F
  • 42,307
  • 41
  • 144
  • 212
5
votes
2 answers

Why errno is not set to EDOM even sqrt takes out of domain arguement?

errno is not being set to EDOM for domain error of sqrt() function in windows It shows correctly on Linux but failed on windows (Using GCC 7.4) ... #include #include #include int main () { double val; errno =…
Tilak_Chad
  • 111
  • 3
5
votes
7 answers

Protractor Process exited with error code 100

I'm trying to setup protractor on different computer. It is using the same files with my other computer (cannot be used because hdisc corrupted). It run fine on my other computer but I am getting error "Process exited with error code 100" when I…
hafizan
  • 111
  • 2
  • 2
  • 7
5
votes
3 answers

Is it possible to send the message produced by perror() to /var/log/syslog?

I'm using perror() to print error messages, like: pid = fork(); if (pid < 0) { perror("couldn't fork"); exit(EXIT_FAILURE); } Is it possible to use errno/perror() facilities but direct the produced messages to the system log…
João M. S. Silva
  • 1,078
  • 2
  • 11
  • 24