git/list[1] front-page[2] threads[3] people[4] search[5] about
 

EAGAIN?

From
Junio C Hamano <junkio@cox.net>
Date
Dec 19, 2005, 10:07 UTC
Message-ID
<7vhd95h02o.fsf@assigned-by-dhcp.cox.net>
I am embarrassed to ask this in public, but anyway.

I was looking at "git grep -n EAGAIN" output and found that many places check "errno == EAGAIN" without checking "errno == EINTR", both for read(2) and write(2). I feel that EAGAIN is probably not that useful (it probably would not hurt us, though) because we do not set up nonblocking ourselves, but I am wondering if there is particular reason to only check EAGAIN but not EINTR, or if they are just cut and paste errors.

	apply.c:: read checks EAGAIN only, write checks both.
        cat-file.c: write checks EAGAIN only.
        copy.c:: read checks EAGAIN only, write checks both.
        mktag.c::  read checks EAGAIN only.
        pkt-line.c:: both read and write checks both.
	tar-tree.c:: write checks EAGAIN only.
        unpack-objects.c:: both read and write checks both.
Next: Linus Torvalds
Message 1 of 6 in “EAGAIN?”
  1. Junio C HamanoDec 19, 2005
  2. Linus TorvaldsDec 19, 2005
  3. H. Peter AnvinDec 19, 2005
  4. xread/xwrite: do not worry about EINTR at calling sites.Junio C Hamano, Dec 20, 2005
  5. Johannes SchindelinDec 20, 2005
  6. Linus TorvaldsDec 20, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.