155bc3719SIngo Weinhold/*
255bc3719SIngo Weinhold * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
355bc3719SIngo Weinhold * Distributed under the terms of the MIT License.
455bc3719SIngo Weinhold */
555bc3719SIngo Weinhold
655bc3719SIngo Weinhold
755bc3719SIngo Weinhold#include <stdarg.h>
85e19679eSAugustin Cavalier#include <fcntl.h>
955bc3719SIngo Weinhold
1055bc3719SIngo Weinhold#include "remapped_functions.h"
1155bc3719SIngo Weinhold
1255bc3719SIngo Weinhold
1355bc3719SIngo Weinhold#if __GNUC__ >= 4
1455bc3719SIngo Weinhold#	define HIDDEN_FUNCTION(function)	do {} while (0)
1555bc3719SIngo Weinhold#	define HIDDEN_FUNCTION_ATTRIBUTE	__attribute__((visibility("hidden")))
1655bc3719SIngo Weinhold#else
1755bc3719SIngo Weinhold#	define HIDDEN_FUNCTION(function)	asm volatile(".hidden " #function)
1855bc3719SIngo Weinhold#	define HIDDEN_FUNCTION_ATTRIBUTE
1955bc3719SIngo Weinhold#endif
2055bc3719SIngo Weinhold
2155bc3719SIngo Weinhold
2255bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
2355bc3719SIngo Weinholdfchmod(int fd, mode_t mode)
2455bc3719SIngo Weinhold{
2555bc3719SIngo Weinhold	HIDDEN_FUNCTION(fchmod);
2655bc3719SIngo Weinhold
2755bc3719SIngo Weinhold	return _haiku_build_fchmod(fd, mode);
2855bc3719SIngo Weinhold}
2955bc3719SIngo Weinhold
3055bc3719SIngo Weinhold
3155bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
3255bc3719SIngo Weinholdfchmodat(int fd, const char* path, mode_t mode, int flag)
3355bc3719SIngo Weinhold{
3455bc3719SIngo Weinhold	HIDDEN_FUNCTION(fchmodat);
3555bc3719SIngo Weinhold
3655bc3719SIngo Weinhold	return _haiku_build_fchmodat(fd, path, mode, flag);
3755bc3719SIngo Weinhold}
3855bc3719SIngo Weinhold
3955bc3719SIngo Weinhold
4055bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
4155bc3719SIngo Weinholdfstat(int fd, struct stat* st)
4255bc3719SIngo Weinhold{
4355bc3719SIngo Weinhold	HIDDEN_FUNCTION(fstat);
4455bc3719SIngo Weinhold
4555bc3719SIngo Weinhold	return _haiku_build_fstat(fd, st);
4655bc3719SIngo Weinhold}
4755bc3719SIngo Weinhold
4855bc3719SIngo Weinhold
4955bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
5055bc3719SIngo Weinholdfstatat(int fd, const char* path, struct stat* st, int flag)
5155bc3719SIngo Weinhold{
5255bc3719SIngo Weinhold	HIDDEN_FUNCTION(fstatat);
5355bc3719SIngo Weinhold
5455bc3719SIngo Weinhold	return _haiku_build_fstatat(fd, path, st, flag);
5555bc3719SIngo Weinhold}
5655bc3719SIngo Weinhold
5755bc3719SIngo Weinhold
5855bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
5955bc3719SIngo Weinholdmkdirat(int fd, const char* path, mode_t mode)
6055bc3719SIngo Weinhold{
6155bc3719SIngo Weinhold	HIDDEN_FUNCTION(mkdirat);
6255bc3719SIngo Weinhold
6355bc3719SIngo Weinhold	return _haiku_build_mkdirat(fd, path, mode);
6455bc3719SIngo Weinhold}
6555bc3719SIngo Weinhold
6655bc3719SIngo Weinhold
6755bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
6855bc3719SIngo Weinholdmkfifoat(int fd, const char* path, mode_t mode)
6955bc3719SIngo Weinhold{
7055bc3719SIngo Weinhold	HIDDEN_FUNCTION(mkfifoat);
7155bc3719SIngo Weinhold
7255bc3719SIngo Weinhold	return _haiku_build_mkfifoat(fd, path, mode);
7355bc3719SIngo Weinhold}
7455bc3719SIngo Weinhold
7555bc3719SIngo Weinhold
7655bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
7755bc3719SIngo Weinholdutimensat(int fd, const char* path, const struct timespec times[2], int flag)
7855bc3719SIngo Weinhold{
7955bc3719SIngo Weinhold	HIDDEN_FUNCTION(utimensat);
8055bc3719SIngo Weinhold
8155bc3719SIngo Weinhold	return _haiku_build_utimensat(fd, path, times, flag);
8255bc3719SIngo Weinhold}
8355bc3719SIngo Weinhold
8455bc3719SIngo Weinhold
8555bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
8655bc3719SIngo Weinholdfutimens(int fd, const struct timespec times[2])
8755bc3719SIngo Weinhold{
8855bc3719SIngo Weinhold	HIDDEN_FUNCTION(futimens);
8955bc3719SIngo Weinhold
9055bc3719SIngo Weinhold	return _haiku_build_futimens(fd, times);
9155bc3719SIngo Weinhold}
9255bc3719SIngo Weinhold
9355bc3719SIngo Weinhold
9455bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
9555bc3719SIngo Weinholdfaccessat(int fd, const char* path, int accessMode, int flag)
9655bc3719SIngo Weinhold{
9755bc3719SIngo Weinhold	HIDDEN_FUNCTION(faccessat);
9855bc3719SIngo Weinhold
9955bc3719SIngo Weinhold	return _haiku_build_faccessat(fd, path, accessMode, flag);
10055bc3719SIngo Weinhold}
10155bc3719SIngo Weinhold
10255bc3719SIngo Weinhold
10355bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
10455bc3719SIngo Weinholdfchdir(int fd)
10555bc3719SIngo Weinhold{
10655bc3719SIngo Weinhold	HIDDEN_FUNCTION(fchdir);
10755bc3719SIngo Weinhold
10855bc3719SIngo Weinhold	return _haiku_build_fchdir(fd);
10955bc3719SIngo Weinhold}
11055bc3719SIngo Weinhold
11155bc3719SIngo Weinhold
11255bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
11355bc3719SIngo Weinholdclose(int fd)
11455bc3719SIngo Weinhold{
11555bc3719SIngo Weinhold	HIDDEN_FUNCTION(close);
11655bc3719SIngo Weinhold
11755bc3719SIngo Weinhold	return _haiku_build_close(fd);
11855bc3719SIngo Weinhold}
11955bc3719SIngo Weinhold
12055bc3719SIngo Weinhold
12155bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
12255bc3719SIngo Weinholddup(int fd)
12355bc3719SIngo Weinhold{
12455bc3719SIngo Weinhold	HIDDEN_FUNCTION(dup);
12555bc3719SIngo Weinhold
12655bc3719SIngo Weinhold	return _haiku_build_dup(fd);
12755bc3719SIngo Weinhold}
12855bc3719SIngo Weinhold
12955bc3719SIngo Weinhold
13055bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
13155bc3719SIngo Weinholddup2(int fd1, int fd2)
13255bc3719SIngo Weinhold{
13355bc3719SIngo Weinhold	HIDDEN_FUNCTION(dup2);
13455bc3719SIngo Weinhold
13555bc3719SIngo Weinhold	return _haiku_build_dup2(fd1, fd2);
13655bc3719SIngo Weinhold}
13755bc3719SIngo Weinhold
13855bc3719SIngo Weinhold
13955bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
14055bc3719SIngo Weinholdlinkat(int toFD, const char* toPath, int pathFD, const char* path, int flag)
14155bc3719SIngo Weinhold{
14255bc3719SIngo Weinhold	HIDDEN_FUNCTION(linkat);
14355bc3719SIngo Weinhold
14455bc3719SIngo Weinhold	return _haiku_build_linkat(toFD, toPath, pathFD, path, flag);
14555bc3719SIngo Weinhold}
14655bc3719SIngo Weinhold
14755bc3719SIngo Weinhold
14855bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
14955bc3719SIngo Weinholdunlinkat(int fd, const char* path, int flag)
15055bc3719SIngo Weinhold{
15155bc3719SIngo Weinhold	HIDDEN_FUNCTION(unlinkat);
15255bc3719SIngo Weinhold
15355bc3719SIngo Weinhold	return _haiku_build_unlinkat(fd, path, flag);
15455bc3719SIngo Weinhold}
15555bc3719SIngo Weinhold
15655bc3719SIngo Weinhold
15755bc3719SIngo Weinholdextern "C" ssize_t HIDDEN_FUNCTION_ATTRIBUTE
15855bc3719SIngo Weinholdreadlinkat(int fd, const char* path, char* buffer, size_t bufferSize)
15955bc3719SIngo Weinhold{
16055bc3719SIngo Weinhold	HIDDEN_FUNCTION(readlinkat);
16155bc3719SIngo Weinhold
16255bc3719SIngo Weinhold	return _haiku_build_readlinkat(fd, path, buffer, bufferSize);
16355bc3719SIngo Weinhold}
16455bc3719SIngo Weinhold
16555bc3719SIngo Weinhold
16655bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
16755bc3719SIngo Weinholdsymlinkat(const char* toPath, int fd, const char* symlinkPath)
16855bc3719SIngo Weinhold{
16955bc3719SIngo Weinhold	HIDDEN_FUNCTION(symlinkat);
17055bc3719SIngo Weinhold
17155bc3719SIngo Weinhold	return _haiku_build_symlinkat(toPath, fd, symlinkPath);
17255bc3719SIngo Weinhold}
17355bc3719SIngo Weinhold
17455bc3719SIngo Weinhold
17555bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
17655bc3719SIngo Weinholdftruncate(int fd, off_t newSize)
17755bc3719SIngo Weinhold{
17855bc3719SIngo Weinhold	HIDDEN_FUNCTION(ftruncate);
17955bc3719SIngo Weinhold
18055bc3719SIngo Weinhold	return _haiku_build_ftruncate(fd, newSize);
18155bc3719SIngo Weinhold}
18255bc3719SIngo Weinhold
18355bc3719SIngo Weinhold
18455bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
18555bc3719SIngo Weinholdfchown(int fd, uid_t owner, gid_t group)
18655bc3719SIngo Weinhold{
18755bc3719SIngo Weinhold	HIDDEN_FUNCTION(fchown);
18855bc3719SIngo Weinhold
18955bc3719SIngo Weinhold	return _haiku_build_fchown(fd, owner, group);
19055bc3719SIngo Weinhold}
19155bc3719SIngo Weinhold
19255bc3719SIngo Weinhold
19355bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
19455bc3719SIngo Weinholdfchownat(int fd, const char* path, uid_t owner, gid_t group, int flag)
19555bc3719SIngo Weinhold{
19655bc3719SIngo Weinhold	HIDDEN_FUNCTION(fchownat);
19755bc3719SIngo Weinhold
19855bc3719SIngo Weinhold	return _haiku_build_fchownat(fd, path, owner, group, flag);
19955bc3719SIngo Weinhold}
20055bc3719SIngo Weinhold
20155bc3719SIngo Weinhold
20255bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
20355bc3719SIngo Weinholdmknodat(int fd, const char* name, mode_t mode, dev_t dev)
20455bc3719SIngo Weinhold{
20555bc3719SIngo Weinhold	HIDDEN_FUNCTION(mknodat);
20655bc3719SIngo Weinhold
20755bc3719SIngo Weinhold	return _haiku_build_mknodat(fd, name, mode, dev);
20855bc3719SIngo Weinhold}
20955bc3719SIngo Weinhold
21055bc3719SIngo Weinhold
21155bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
21255bc3719SIngo Weinholdcreat(const char* path, mode_t mode)
21355bc3719SIngo Weinhold{
2145e19679eSAugustin Cavalier	HIDDEN_FUNCTION(creat);
21555bc3719SIngo Weinhold
21655bc3719SIngo Weinhold	return _haiku_build_creat(path, mode);
21755bc3719SIngo Weinhold}
21855bc3719SIngo Weinhold
21955bc3719SIngo Weinhold
22055bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
22155bc3719SIngo Weinholdopen(const char* path, int openMode, ...)
22255bc3719SIngo Weinhold{
22355bc3719SIngo Weinhold	HIDDEN_FUNCTION(open);
22455bc3719SIngo Weinhold
22555bc3719SIngo Weinhold	mode_t permissions = 0;
22655bc3719SIngo Weinhold	if ((openMode & O_CREAT) != 0) {
22755bc3719SIngo Weinhold		va_list args;
22855bc3719SIngo Weinhold		va_start(args, openMode);
22955bc3719SIngo Weinhold		mode_t mask = umask(0);
23055bc3719SIngo Weinhold		umask(mask);
23155bc3719SIngo Weinhold		permissions = va_arg(args, int);
23255bc3719SIngo Weinhold		va_end(args);
23355bc3719SIngo Weinhold	}
23455bc3719SIngo Weinhold
23555bc3719SIngo Weinhold	return _haiku_build_open(path, openMode, permissions);
23655bc3719SIngo Weinhold}
23755bc3719SIngo Weinhold
23855bc3719SIngo Weinhold
23955bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
24055bc3719SIngo Weinholdopenat(int fd, const char* path, int openMode, ...)
24155bc3719SIngo Weinhold{
24255bc3719SIngo Weinhold	HIDDEN_FUNCTION(openat);
24355bc3719SIngo Weinhold
24455bc3719SIngo Weinhold	mode_t permissions = 0;
24555bc3719SIngo Weinhold	if ((openMode & O_CREAT) != 0) {
24655bc3719SIngo Weinhold		va_list args;
24755bc3719SIngo Weinhold		va_start(args, openMode);
24855bc3719SIngo Weinhold		mode_t mask = umask(0);
24955bc3719SIngo Weinhold		umask(mask);
25055bc3719SIngo Weinhold		permissions = va_arg(args, int);
25155bc3719SIngo Weinhold		va_end(args);
25255bc3719SIngo Weinhold	}
25355bc3719SIngo Weinhold
25455bc3719SIngo Weinhold	return _haiku_build_openat(fd, path, openMode, permissions);
25555bc3719SIngo Weinhold}
25655bc3719SIngo Weinhold
25755bc3719SIngo Weinhold
25855bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
25955bc3719SIngo Weinholdfcntl(int fd, int op, ...)
26055bc3719SIngo Weinhold{
26155bc3719SIngo Weinhold	HIDDEN_FUNCTION(fcntl);
26255bc3719SIngo Weinhold
26355bc3719SIngo Weinhold	va_list args;
26455bc3719SIngo Weinhold	va_start(args, op);
26555bc3719SIngo Weinhold	int argument = va_arg(args, int);
26655bc3719SIngo Weinhold	va_end(args);
26755bc3719SIngo Weinhold
26855bc3719SIngo Weinhold	return _haiku_build_fcntl(fd, op, argument);
26955bc3719SIngo Weinhold}
27055bc3719SIngo Weinhold
27155bc3719SIngo Weinhold
27255bc3719SIngo Weinholdextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
27355bc3719SIngo Weinholdrenameat(int fromFD, const char* from, int toFD, const char* to)
27455bc3719SIngo Weinhold{
27555bc3719SIngo Weinhold	HIDDEN_FUNCTION(renameat);
27655bc3719SIngo Weinhold
27755bc3719SIngo Weinhold	return _haiku_build_renameat(fromFD, from, toFD, to);
27855bc3719SIngo Weinhold}
279648f0d5fSAugustin Cavalier
280648f0d5fSAugustin Cavalier
281648f0d5fSAugustin Cavalier#if defined(HAIKU_HOST_USE_XATTR) && defined(HAIKU_HOST_PLATFORM_HAIKU)
282648f0d5fSAugustin Cavalier// fs_attr_* functions only need to be remapped on Haiku
283648f0d5fSAugustin Cavalier
284648f0d5fSAugustin Cavalier
285d2845248SJessica Hamiltonextern "C" addr_t HIDDEN_FUNCTION_ATTRIBUTE
286648f0d5fSAugustin Cavalierfs_open_attr_dir(const char *path)
287648f0d5fSAugustin Cavalier{
288648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_open_attr_dir);
289648f0d5fSAugustin Cavalier
290d2845248SJessica Hamilton	return (addr_t)_haiku_build_fs_open_attr_dir(path);
291648f0d5fSAugustin Cavalier}
292648f0d5fSAugustin Cavalier
293648f0d5fSAugustin Cavalier
294d2845248SJessica Hamiltonextern "C" addr_t HIDDEN_FUNCTION_ATTRIBUTE
295648f0d5fSAugustin Cavalierfs_lopen_attr_dir(const char *path)
296648f0d5fSAugustin Cavalier{
297648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_lopen_attr_dir);
298648f0d5fSAugustin Cavalier
299d2845248SJessica Hamilton	return (addr_t)_haiku_build_fs_lopen_attr_dir(path);
300648f0d5fSAugustin Cavalier}
301648f0d5fSAugustin Cavalier
302648f0d5fSAugustin Cavalier
303d2845248SJessica Hamiltonextern "C" addr_t HIDDEN_FUNCTION_ATTRIBUTE
304648f0d5fSAugustin Cavalierfs_fopen_attr_dir(int fd)
305648f0d5fSAugustin Cavalier{
306648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_fopen_attr_dir);
307648f0d5fSAugustin Cavalier
308d2845248SJessica Hamilton	return (addr_t)_haiku_build_fs_fopen_attr_dir(fd);
309648f0d5fSAugustin Cavalier}
310648f0d5fSAugustin Cavalier
311648f0d5fSAugustin Cavalier
312648f0d5fSAugustin Cavalierextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
313648f0d5fSAugustin Cavalierfs_close_attr_dir(void *dir)
314648f0d5fSAugustin Cavalier{
315648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_close_attr_dir);
316648f0d5fSAugustin Cavalier
317648f0d5fSAugustin Cavalier	return _haiku_build_fs_close_attr_dir(dir);
318648f0d5fSAugustin Cavalier}
319648f0d5fSAugustin Cavalier
320648f0d5fSAugustin Cavalier
321d2845248SJessica Hamiltonextern "C" addr_t HIDDEN_FUNCTION_ATTRIBUTE
322648f0d5fSAugustin Cavalierfs_read_attr_dir(void *dir)
323648f0d5fSAugustin Cavalier{
324648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_read_attr_dir);
325648f0d5fSAugustin Cavalier
326d2845248SJessica Hamilton	return (addr_t)_haiku_build_fs_read_attr_dir(dir);
327648f0d5fSAugustin Cavalier}
328648f0d5fSAugustin Cavalier
329648f0d5fSAugustin Cavalier
330648f0d5fSAugustin Cavalierextern "C" void HIDDEN_FUNCTION_ATTRIBUTE
331648f0d5fSAugustin Cavalierfs_rewind_attr_dir(void *dir)
332648f0d5fSAugustin Cavalier{
333648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_rewind_attr_dir);
334648f0d5fSAugustin Cavalier
335648f0d5fSAugustin Cavalier	_haiku_build_fs_rewind_attr_dir(dir);
336648f0d5fSAugustin Cavalier}
337648f0d5fSAugustin Cavalier
338648f0d5fSAugustin Cavalier
339648f0d5fSAugustin Cavalierextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
340648f0d5fSAugustin Cavalierfs_fopen_attr(int fd, const char *attribute, uint32 type, int openMode)
341648f0d5fSAugustin Cavalier{
342648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_fopen_attr);
343648f0d5fSAugustin Cavalier
344648f0d5fSAugustin Cavalier	return _haiku_build_fs_fopen_attr(fd, attribute, type, openMode);
345648f0d5fSAugustin Cavalier}
346648f0d5fSAugustin Cavalier
347648f0d5fSAugustin Cavalier
348648f0d5fSAugustin Cavalierextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
349648f0d5fSAugustin Cavalierfs_close_attr(int fd)
350648f0d5fSAugustin Cavalier{
351648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_close_attr);
352648f0d5fSAugustin Cavalier
353648f0d5fSAugustin Cavalier	return _haiku_build_fs_close_attr(fd);
354648f0d5fSAugustin Cavalier}
355648f0d5fSAugustin Cavalier
356648f0d5fSAugustin Cavalier
357648f0d5fSAugustin Cavalierextern "C" ssize_t HIDDEN_FUNCTION_ATTRIBUTE
358648f0d5fSAugustin Cavalierfs_read_attr(int fd, const char* attribute, uint32 type, off_t pos,
359648f0d5fSAugustin Cavalier	void *buffer, size_t readBytes)
360648f0d5fSAugustin Cavalier{
361648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_read_attr);
362648f0d5fSAugustin Cavalier
363648f0d5fSAugustin Cavalier	return _haiku_build_fs_read_attr(fd, attribute, type, pos, buffer,
364648f0d5fSAugustin Cavalier		readBytes);
365648f0d5fSAugustin Cavalier}
366648f0d5fSAugustin Cavalier
367648f0d5fSAugustin Cavalier
368648f0d5fSAugustin Cavalierextern "C" ssize_t HIDDEN_FUNCTION_ATTRIBUTE
369648f0d5fSAugustin Cavalierfs_write_attr(int fd, const char* attribute, uint32 type, off_t pos,
370648f0d5fSAugustin Cavalier	const void *buffer, size_t writeBytes)
371648f0d5fSAugustin Cavalier{
372648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_write_attr);
373648f0d5fSAugustin Cavalier
374648f0d5fSAugustin Cavalier	return _haiku_build_fs_write_attr(fd, attribute, type, pos, buffer,
375648f0d5fSAugustin Cavalier		writeBytes);
376648f0d5fSAugustin Cavalier}
377648f0d5fSAugustin Cavalier
378648f0d5fSAugustin Cavalier
379648f0d5fSAugustin Cavalierextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
380648f0d5fSAugustin Cavalierfs_remove_attr(int fd, const char* attribute)
381648f0d5fSAugustin Cavalier{
382648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_remove_attr);
383648f0d5fSAugustin Cavalier
384648f0d5fSAugustin Cavalier	return _haiku_build_fs_remove_attr(fd, attribute);
385648f0d5fSAugustin Cavalier}
386648f0d5fSAugustin Cavalier
387648f0d5fSAugustin Cavalier
388648f0d5fSAugustin Cavalierextern "C" int HIDDEN_FUNCTION_ATTRIBUTE
389648f0d5fSAugustin Cavalierfs_stat_attr(int fd, const char *attribute, struct attr_info *attrInfo)
390648f0d5fSAugustin Cavalier{
391648f0d5fSAugustin Cavalier	HIDDEN_FUNCTION(fs_stat_attr);
392648f0d5fSAugustin Cavalier
393648f0d5fSAugustin Cavalier	return _haiku_build_fs_stat_attr(fd, attribute, attrInfo);
394648f0d5fSAugustin Cavalier}
395648f0d5fSAugustin Cavalier
396648f0d5fSAugustin Cavalier#endif // defined(HAIKU_HOST_USE_XATTR) && defined(HAIKU_HOST_PLATFORM_HAIKU)
397