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
8
votes
3 answers

IOError: [Errno 2] No such file or directory (when it really exist) Python

I'm working on transfer folder of files via uart in python. Below you see simple function, but there is a problem because I get error like in title : IOError: [Errno 2] No such file or directory: '1.jpg' where 1.jpg is one of the files in test…
user8207105
8
votes
11 answers

Convert POSIX integer errno to compile-time constant

Occasionally (e.g. using strace, gdb etc) one finds a POSIX call sets errno to an integer value, and one wants to know the compile time C constant (more accurately pre-processor define) to check for it (e.g. ECHILD) - see e.g. waitpid for child…
abligh
  • 24,573
  • 4
  • 47
  • 84
8
votes
1 answer

Meaning of error numbers in Python exceptions

Catching Python's OverflowError after some dumb calculation, I checked the error's args and saw it's a tuple containing an integer as its first coordinate. I assume this is some kind of error number (errno). However, I could not find any…
Bach
  • 6,145
  • 7
  • 36
  • 61
8
votes
1 answer

Socket bind failed errno = 99

I'm trying to bind the server socket so I can receive and listen for incoming messages from other clients. But I can't bind, it returns an error - Socket bind failed: 99. I read up what does it mean and it says that errno 99 indicates that the…
Broccoli
  • 81
  • 1
  • 1
  • 2
8
votes
1 answer

`getErrno` and threads

The documentation for getErrno reads: Get the current value of errno in the current thread. It is unclear to me whether this means the current OS thread. In particular, does the (threaded) runtime fetch and stash away errno whenever a Haskell…
gspr
  • 11,144
  • 3
  • 41
  • 74
8
votes
1 answer

python multiprocessing socket.error: [Errno 111] Connection refused?

I am doing a simple server/client connection using multiprocessing in python 2.7. When I run the client code in a seperate python shell, the connection is successful, but when I run the application as a whole, I get "socket.error: [Errno 111]…
user1598655
  • 159
  • 2
  • 5
8
votes
4 answers

why fopen() or open() use errno instead of just returning error code?

In usual case open() return the new file descriptor, or -1 if an error occurred and in that case, errno is set appropriately. I am not understanding why this mechanism of errno is used here? whats the purpose of here? why just we can not map all…
Jeegar Patel
  • 26,264
  • 51
  • 149
  • 222
7
votes
2 answers

Error Compiling CSS Asset

I have been trying to deploy a Rail 3.1.1 app on CentOS 6 This is the error I am getting Error Compiling CSS Errno::ENOENT: No Such File or Directory -…
Steffan Perry
  • 2,112
  • 1
  • 21
  • 21
7
votes
0 answers

How to find the offending file for 'fopen failed for data file: errno = 2 (No such file or directory)'

I have a Swift/SpriteKit project with an App Clip. The app clip compiles on the Simulator (though it crashes when tested via TestFlight), but I receive the error fopen failed for data file: errno = 2 (No such file or directory). However, the…
West1
  • 1,430
  • 16
  • 27
7
votes
0 answers

Python urllib2 and [errno 10054] An existing connection was forcibly closed by the remote host and a few urllib2 problems

I've written a crawler that uses urllib2 to fetch URLs. every few requests I get some weird behaviors, I've tried analyzing it with Wireshark and couldn't understand the problem. getPAGE() is responsible for fetching the URL. it returns the content…
YSY
  • 1,226
  • 3
  • 13
  • 19
7
votes
1 answer

OSError's filename attribute unavailable?

I have the following code: except(OSError) as (errno, strerror, filename): print "OSError [%d]: %s at %s" % (errno, strerror, filename) It runs great unless it meets OSError num. 123 (The file name, directory name, or volume label syntax is…
Alex58
  • 73
  • 1
  • 1
  • 3
7
votes
2 answers

fread and ferror don't set errno

I'm trying to check when fread() raises an error, so I use ferror(). chunk = fread(buf, 1, 100, file); if (ferror(file)) { return errno; } But, ferror() man page (man 3 ferror, or just man ferror) says: ERRORS These functions should not…
Mahmoud Mubarak
  • 139
  • 1
  • 11
7
votes
8 answers

Unit testing error conditions - EINTR

In short, how do you unit test an error condition such as EINTR on a system call. One particular example I'm working on, which could be a case all by itself, is whether it's necessary to call fclose again when it returns EOF with (errno==EINTR). The…
Michael Smith
  • 71
  • 1
  • 3
7
votes
1 answer

Setting a watchpoint on errno in gdb

I'm trying to find out when errno changes. At first, I tried "watch errno" in gdb, which led to the error Cannot find thread-local variables on this target I was able to fix this by compiling with "-pthread". However, it still doesn't work and I…
Hermann Speiche
  • 894
  • 1
  • 9
  • 16
6
votes
1 answer

Simple messaging application...getting errno 14: bad address

I am writing a simple messaging application in C using sockets. When I use function recvfrom, it returns -1 and sets errno = 14 which is Bad address (which I am printing at the end). The strange thing is that it still reads from the socket and gets…
mmtauqir
  • 8,499
  • 9
  • 34
  • 42