On Wed, Aug 22, 2012 at 5:31 AM, Roland Mainz roland.ma...@nrubsig.org wrote:
Attached (as gisburn_ast_openat_emulation20120820.c.txt) is a first
try for an |openat()|*co. emulation code.
[snip]
Attached (as gisburn_fsat_emu_002_ast_map_fsat.h.txt and
gisburn_fsat_emu_002_ast_fsat_emu.c.txt) is a slightly newer, more
complete version...
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.ma...@nrubsig.org
\__\/\/__/ MPEG specialist, CJAVASunUnix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
#ifndef AST_MAP_FSAT_H
#define AST_MAP_FSAT_H 1
/***
* *
* This software is part of the ast package *
* Copyright (c) 2012 ATT Intellectual Property*
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
*by ATT Intellectual Property *
* *
*A copy of the License is available at *
* http://www.eclipse.org/org/documents/epl-v10.html *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
*ATT Research *
* Florham Park NJ*
* *
* Roland Mainz roland.ma...@nrubsig.org*
* *
***/
/*
* This header defines provide an easy way for legacy applications
* to use the new POSIX |*at()|-APIs.
*
* This is mainly intended for operating systems which already map
* the old calls to the new |*at()| calls, therefore the macros
* below bypass a lot of wrapper code in libc.
* The other usage is _testing_ the code in libc and the |*at())
* emulation code in libast
*/
/*
* How should we map these with CPP ? ;-(
*
* open(path, flag, ...)openat(AT_FDCWD, (path), (flag), ...)
* creat(path, ...) openat(AT_FDCWD, (path),
O_WRONLY|O_CREAT|O_TRUNC, ...)
*/
#define unlink(path)unlinkat(AT_FDCWD, (path), 0)
#define rmdir(path) unlinkat(AT_FDCWD, (path), AT_REMOVEDIR)
#define chown(path, uid, gid) fchownat(AT_FDCWD, (path), (uid),
(gid), 0)
#define lchown(path, uid, gid) fchownat(AT_FDCWD, (path), (uid),
(gid), AT_SYMLINK_NOFOLLOW)
#define fchown(fd, uid, gid)fchownat((fd), NULL, (uid), (gid), 0)
#define stat(path, sb) fstatat(AT_FDCWD, (path), (sb), 0)
#define lstat(path, sb) fstatat(AT_FDCWD, (path), (sb),
AT_SYMLINK_NOFOLLOW)
#define fstat(fd, sb) fstatat((fd), NULL, (sb), 0)
#define rename(oldname, newname)renameat(AT_FDCWD, (oldname), AT_FDCWD,
(newname))
#define access(path, amode) faccessat(AT_FDCWD, (path), (amode), 0)
#define eaccess(path, amode)faccessat(AT_FDCWD, (path), (amode),
AT_EACCESS)
#define mkdir(path, amode) mkdirat(AT_FDCWD, (path), (amode))
#define mkfifo(path, amode) mkfifoat(AT_FDCWD, (path), (amode))
#define mknod(path, amode, adev)mknodat(AT_FDCWD, (path), (amode),
(adev))
#endif /* !AST_MAP_FSAT_H */
/***
* *
* This software is part of the ast package *
* Copyright (c) 2012 ATT Intellectual Property*
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
*by ATT Intellectual Property *
* *
*A copy of the License is available at *
* http://www.eclipse.org/org/documents/epl-v10.html *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
*ATT Research *
* Florham Park NJ*
* *
* Roland Mainz roland.ma...@nrubsig.org*
*