[ast-developers] Re: |*at()|-emulation... 2nd prototype...

2012-08-27 Thread Roland Mainz
On Tue, Aug 28, 2012 at 2:11 AM, Roland Mainz roland.ma...@nrubsig.org wrote:
 Attached (as astksh_fs_at_emulation002.diff.txt) is the 2nd
 prototype patch which adds a POSIX |*at()| emulation (e.g.
 |openat()|co.) to libast.

 Notes:
 - Only tested with ast-ksh.2012-08-24, not ast-open (yet)

ast-open.2012-08-24 compiles OK.
note that some applications _may_ fail if they do something like
#define fchdir() or #define chdir() ... these functions or cpp macros
MUST redirect to |ast_fchdir()| and |ast_chdir()| since the |*at()|
emulation remembers the last fd used to do some optimisations. If
|ast_fchdir()| and |ast_chdir()| are bypassed then this remembered
fd is likely stale and might cause subtle failures. This is not a
bug.



Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, CJAVASunUnix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
___
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers


[ast-developers] Re: |*at()|-emulation... 2nd prototype...

2012-08-27 Thread Roland Mainz
On Tue, Aug 28, 2012 at 2:33 AM, Roland Mainz roland.ma...@nrubsig.org wrote:
 On Tue, Aug 28, 2012 at 2:11 AM, Roland Mainz roland.ma...@nrubsig.org 
 wrote:
 Attached (as astksh_fs_at_emulation002.diff.txt) is the 2nd
 prototype patch which adds a POSIX |*at()| emulation (e.g.
 |openat()|co.) to libast.

 Notes:
 - Only tested with ast-ksh.2012-08-24, not ast-open (yet)

 ast-open.2012-08-24 compiles OK.
 note that some applications _may_ fail if they do something like
 #define fchdir() or #define chdir() ... these functions or cpp macros
 MUST redirect to |ast_fchdir()| and |ast_chdir()| since the |*at()|
 emulation remembers the last fd used to do some optimisations. If
 |ast_fchdir()| and |ast_chdir()| are bypassed then this remembered
 fd is likely stale and might cause subtle failures. This is not a
 bug.

*sigh* ... and add |close()| -- |ast_close()| ... which I forgot even
in my own code. Welcome to sane programming at 2:30h AM... ;-(



Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, CJAVASunUnix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
___
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers