Difference between Linux errno 23 and Linux errno 24

badri picture badri · Jul 21, 2014 · Viewed 11.3k times · Source
  1. What is the difference between these 2 linux errors in errno.h? 23 and 24

    I tried 2 different sites but can't understand difference between the two.


    [EMFILE]
    Too many open files.
    [ENFILE]
    Too many files open in system.
    

    # define ENFILE      23  /* File table overflow */
    # define EMFILE      24  /* Too many open files */
    

  2. Also, I am getting errno 24 and socket call failing at 974th time. (AF_INET UDP datagram socket)

    When I did a cat /proc/sys/fs/file-max I am seeing a value of 334076 ulimit -n showing 1024

    Any idea what can be done to increase limit?

Answer

Wojtek Surowka picture Wojtek Surowka · Jul 21, 2014

For 1) Both error codes are about the situation with too many opened files. EMFILE is too many files opened in your process. ENFILE is too many files opened in the entire system.