2 * hl-stub.c -- provide _kill() and _getpid().
4 * Copyright (c) 2024 Synopsys Inc.
6 * The authors hereby grant permission to use, copy, modify, distribute,
7 * and license this software and its documentation for any purpose, provided
8 * that existing copyright notices are retained in all copies and that this
9 * notice is included verbatim in any distributions. No written agreement,
10 * license, or royalty fee is required for any of the authorized uses.
11 * Modifications to this software may be copyrighted by their authors
12 * and need not follow the licensing terms described here, provided that
13 * the new terms are clearly indicated on the first page of each file where
21 #include <sys/times.h>
22 #include <sys/types.h>
29 /* If PID is equal to __MYPID, exit with sig as retcode. */
31 _kill (int pid
, int sig
)
48 /* We do not have 64-bit compatible hostlink fstat. */
49 #if defined (__ARC64__)
51 _fstat (int fd
, struct stat
*st
)
53 memset (st
, 0, sizeof (*st
));
54 st
->st_mode
= S_IFCHR
;
55 st
->st_blksize
= 1024;
62 /* hostlink backend has only fstat(), so use fstat() in stat(). */
64 _stat (const char *pathname
, struct stat
*buf
)
70 fd
= open (pathname
, O_RDONLY
);
73 /* errno is set by open(). */
77 ret
= fstat (fd
, buf
);
88 /* No Metaware hostlink backend for this call. */
90 _link (const char *oldpath
__attribute__ ((unused
)),
91 const char *newpath
__attribute__ ((unused
)))