zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: PATCH: allocating a new file descriptor
Date: Fri, 15 Apr 2005 16:19:14 +0000	[thread overview]
Message-ID: <1050415161914.ZM19005@candle.brasslantern.com> (raw)
In-Reply-To: <200504151027.j3FARBdH004522@news01.csr.com>

On Apr 15, 11:27am, Peter Stephenson wrote:
}
} > I also noticed several problems when fidling with fds used
} > internally by zsh (zsocket -d10 or -d11 ended up in a core
} > dump).
} 
} Yes, it doesn't check for existing use of the fd by the shell.
} 
} The same problem exists with the new syntax when closing fd's; I've made
} it check for special fd's, which are those from 10 upwards marked as for
} internal use.  This covers 10, but not 11; I'm not sure what opened
} that, but I think it's some library rather than the shell itself.
} If we can track it down it could be marked as in internal use, too.
} 
} (Maybe it's about time we introduced zwarn and friends to stdarg.h...)

Also maybe it's time we introduced an API in the main part of zsh for
opening and closing files, so that we can stop doing things like this ...

} -unsigned char *fdtable;
} +mod_export unsigned char *fdtable;

[...]

} Index: Src/Modules/socket.c
} ===================================================================
} +	if (targetfd <= max_zsh_fd && fdtable[targetfd] != FDT_UNUSED) {

... and instead encapsulate those sorts of tests in the API functions.
The number of exported globals is starting to bother me; it feels as if
every second patch that's gone by in the past few months has exported
another previously-hidden global symbol.


  reply	other threads:[~2005-04-15 16:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-12 12:57 Peter Stephenson
2005-04-12 17:35 ` Peter Stephenson
2005-04-14  4:57 ` Bart Schaefer
2005-04-14  9:49   ` Peter Stephenson
2005-04-14 14:23     ` Bart Schaefer
2005-04-14 16:16       ` Peter Stephenson
2005-04-14 18:10         ` Stephane Chazelas
2005-04-15 10:27           ` Peter Stephenson
2005-04-15 16:19             ` Bart Schaefer [this message]
2005-04-15 19:06               ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1050415161914.ZM19005@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).