fixed a build issue for missing lchown against old macosx sdks

added Awk::writeConsoleBytes(), Awk::writePipeBytes(), Awk::writeFileBytes()
This commit is contained in:
2019-04-23 08:41:05 +00:00
parent 50eec135d8
commit 03301b79bf
7 changed files with 59 additions and 14 deletions

View File

@ -2020,6 +2020,12 @@ Awk::ssize_t Awk::writePipe (Pipe& io, const char_t* buf, size_t len)
return -1;
}
Awk::ssize_t Awk::writePipeBytes (Pipe& io, const qse_mchar_t* buf, size_t len)
{
((Run*)io)->setError (QSE_AWK_ENOIMPL);
return -1;
}
int Awk::flushPipe (Pipe& io)
{
((Run*)io)->setError (QSE_AWK_ENOIMPL);
@ -2050,6 +2056,12 @@ Awk::ssize_t Awk::writeFile (File& io, const char_t* buf, size_t len)
return -1;
}
Awk::ssize_t Awk::writeFileBytes (File& io, const qse_mchar_t* buf, size_t len)
{
((Run*)io)->setError (QSE_AWK_ENOIMPL);
return -1;
}
int Awk::flushFile (File& io)
{
((Run*)io)->setError (QSE_AWK_ENOIMPL);
@ -2080,6 +2092,12 @@ Awk::ssize_t Awk::writeConsole (Console& io, const char_t* buf, size_t len)
return -1;
}
Awk::ssize_t Awk::writeConsoleBytes (Console& io, const qse_mchar_t* buf, size_t len)
{
((Run*)io)->setError (QSE_AWK_ENOIMPL);
return -1;
}
int Awk::flushConsole (Console& io)
{
((Run*)io)->setError (QSE_AWK_ENOIMPL);

View File

@ -338,7 +338,10 @@
# define QSE_CHROOT(path) QSE_LIBCALL1(chroot,path)
#endif
#if defined(SYS_lchown) && defined(QSE_USE_SYSCALL)
#if !defined(SYS_lchown) && !defined(HAVE_LCHOWN) && defined(__APPLE__) && defined(__MACH__) && defined(__POWERPC__)
/* special handling for old darwin/macosx sdks */
# define QSE_LCHOWN(path,owner,group) syscall(364,path,owner,group)
#elif defined(SYS_lchown) && defined(QSE_USE_SYSCALL)
# define QSE_LCHOWN(path,owner,group) syscall(SYS_lchown,path,owner,group)
#else
# define QSE_LCHOWN(path,owner,group) QSE_LIBCALL3(lchown,path,owner,group)

View File

@ -346,9 +346,9 @@ int qse_fs_setattrsys (qse_fs_t* fs, qse_fs_char_t* path, const qse_fattr_t* att
int x;
if (flags & QSE_FILE_ATTR_SYMLINK)
x = QSE_LCHOWN (path, attr->uid, attr->gid);
x = QSE_LCHOWN(path, attr->uid, attr->gid);
else
x = QSE_CHOWN (path, attr->uid, attr->gid);
x = QSE_CHOWN(path, attr->uid, attr->gid);
if (x <= -1)
{

View File

@ -34,6 +34,7 @@
/* TODO: windows event log */
#else
#include <syslog.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/un.h>

View File

@ -35,6 +35,7 @@
#else
# include <setjmp.h>
# if defined(HAVE_UCONTEXT_H)
# include <signal.h> /* for old DARWIN/MACOSX */
# include <ucontext.h>
# endif
# if defined(HAVE_MAKECONTEXT) && defined(HAVE_SWAPCONTEXT) && \