data_type large_stringclasses 3
values | source large_stringclasses 29
values | code large_stringlengths 98 49.4M | filepath large_stringlengths 5 161 ⌀ | message large_stringclasses 234
values | commit large_stringclasses 234
values | subject large_stringclasses 418
values | critique large_stringlengths 101 1.26M ⌀ | metadata dict |
|---|---|---|---|---|---|---|---|---|
source | musl | #define _BSD_SOURCE
#include <stdlib.h>
#include "libc.h"
void *valloc(size_t size)
{
return memalign(PAGE_SIZE, size);
} | src/legacy/valloc.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sys/time.h>
#include <sys/timex.h>
#include <errno.h>
#include "syscall.h"
int adjtime(const struct timeval *in, struct timeval *out)
{
struct timex tx = { 0 };
if (in) {
if (in->tv_sec > 1000 || in->tv_usec > 1000000000) {
errno = EINVAL;
return -1;
}
tx.offset = in->tv_sec... | src/linux/adjtime.c | null | null | null | null | null |
source | musl | #include <sys/timex.h>
#include <time.h>
int adjtimex(struct timex *tx)
{
return clock_adjtime(CLOCK_REALTIME, tx);
} | src/linux/adjtimex.c | null | null | null | null | null |
source | musl | #include "syscall.h"
#ifdef SYS_arch_prctl
int arch_prctl(int code, unsigned long addr)
{
return syscall(SYS_arch_prctl, code, addr);
}
#endif | src/linux/arch_prctl.c | null | null | null | null | null |
source | musl | #define _BSD_SOURCE
#include <unistd.h>
#include <errno.h>
#include "syscall.h"
int brk(void *end)
{
return __syscall_ret(-ENOMEM);
} | src/linux/brk.c | null | null | null | null | null |
source | musl | #include <errno.h>
#include "syscall.h"
#include "atomic.h"
#ifdef SYS_cacheflush
int _flush_cache(void *addr, int len, int op)
{
return syscall(SYS_cacheflush, addr, len, op);
}
weak_alias(_flush_cache, cacheflush);
#endif
#ifdef SYS_cachectl
int __cachectl(void *addr, int len, int op)
{
return syscall(SYS_cachect... | src/linux/cache.c | null | null | null | null | null |
source | musl | #include "syscall.h"
int capset(void *a, void *b)
{
return syscall(SYS_capset, a, b);
}
int capget(void *a, void *b)
{
return syscall(SYS_capget, a, b);
} | src/linux/cap.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <unistd.h>
#include "syscall.h"
int chroot(const char *path)
{
return syscall(SYS_chroot, path);
} | src/linux/chroot.c | null | null | null | null | null |
source | musl | #include <sys/timex.h>
#include <time.h>
#include <errno.h>
#include "syscall.h"
#define IS32BIT(x) !((x)+0x80000000ULL>>32)
struct ktimex64 {
unsigned modes;
int :32;
long long offset, freq, maxerror, esterror;
int status;
int :32;
long long constant, precision, tolerance;
long long time_sec, time_usec;
long... | src/linux/clock_adjtime.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <stdarg.h>
#include <unistd.h>
#include <sched.h>
#include "pthread_impl.h"
#include "syscall.h"
#include "lock.h"
#include "fork_impl.h"
struct clone_start_args {
int (*func)(void *);
void *arg;
sigset_t sigmask;
};
static int clone_start(void *arg)
{
struct clone_start_args *csa = a... | src/linux/clone.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <unistd.h>
#include "syscall.h"
ssize_t copy_file_range(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned flags)
{
return syscall(SYS_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags);
} | src/linux/copy_file_range.c | null | null | null | null | null |
source | musl | #include <sys/epoll.h>
#include <signal.h>
#include <errno.h>
#include "syscall.h"
int epoll_create(int size)
{
if (size<=0) return __syscall_ret(-EINVAL);
return epoll_create1(0);
}
int epoll_create1(int flags)
{
int r = __syscall(SYS_epoll_create1, flags);
#ifdef SYS_epoll_create
if (r==-ENOSYS && !flags) r = _... | src/linux/epoll.c | null | null | null | null | null |
source | musl | #include <sys/eventfd.h>
#include <unistd.h>
#include <errno.h>
#include "syscall.h"
int eventfd(unsigned int count, int flags)
{
int r = __syscall(SYS_eventfd2, count, flags);
#ifdef SYS_eventfd
if (r==-ENOSYS && !flags) r = __syscall(SYS_eventfd, count);
#endif
return __syscall_ret(r);
}
int eventfd_read(int fd,... | src/linux/eventfd.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <fcntl.h>
#include "syscall.h"
int fallocate(int fd, int mode, off_t base, off_t len)
{
return syscall(SYS_fallocate, fd, mode, __SYSCALL_LL_E(base),
__SYSCALL_LL_E(len));
} | src/linux/fallocate.c | null | null | null | null | null |
source | musl | #include "syscall.h"
#include <sys/fanotify.h>
int fanotify_init(unsigned flags, unsigned event_f_flags)
{
return syscall(SYS_fanotify_init, flags, event_f_flags);
}
int fanotify_mark(int fanotify_fd, unsigned flags, unsigned long long mask,
int dfd, const char *pathname)
{
return syscall(SYS_fanotify_ma... | src/linux/fanotify.c | null | null | null | null | null |
source | musl | #include <sys/file.h>
#include "syscall.h"
int flock(int fd, int op)
{
return syscall(SYS_flock, fd, op);
} | src/linux/flock.c | null | null | null | null | null |
source | musl | #define _BSD_SOURCE
#include <dirent.h>
#include <limits.h>
#include "syscall.h"
int getdents(int fd, struct dirent *buf, size_t len)
{
if (len>INT_MAX) len = INT_MAX;
return syscall(SYS_getdents, fd, buf, len);
} | src/linux/getdents.c | null | null | null | null | null |
source | musl | #include <sys/random.h>
#include "syscall.h"
ssize_t getrandom(void *buf, size_t buflen, unsigned flags)
{
return syscall_cp(SYS_getrandom, buf, buflen, flags);
} | src/linux/getrandom.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <unistd.h>
#include "pthread_impl.h"
pid_t gettid(void)
{
return __pthread_self()->tid;
} | src/linux/gettid.c | null | null | null | null | null |
source | musl | #include <sys/inotify.h>
#include <errno.h>
#include "syscall.h"
int inotify_init()
{
return inotify_init1(0);
}
int inotify_init1(int flags)
{
int r = __syscall(SYS_inotify_init1, flags);
#ifdef SYS_inotify_init
if (r==-ENOSYS && !flags) r = __syscall(SYS_inotify_init);
#endif
return __syscall_ret(r);
}
int inot... | src/linux/inotify.c | null | null | null | null | null |
source | musl | #include "syscall.h"
#ifdef SYS_ioperm
#include <sys/io.h>
int ioperm(unsigned long from, unsigned long num, int turn_on)
{
return syscall(SYS_ioperm, from, num, turn_on);
}
#endif | src/linux/ioperm.c | null | null | null | null | null |
source | musl | #include "syscall.h"
#ifdef SYS_iopl
#include <sys/io.h>
int iopl(int level)
{
return syscall(SYS_iopl, level);
}
#endif | src/linux/iopl.c | null | null | null | null | null |
source | musl | #include <sys/klog.h>
#include "syscall.h"
int klogctl (int type, char *buf, int len)
{
return syscall(SYS_syslog, type, buf, len);
} | src/linux/klogctl.c | null | null | null | null | null |
source | musl | #include <sys/membarrier.h>
#include <semaphore.h>
#include <signal.h>
#include <string.h>
#include "pthread_impl.h"
#include "syscall.h"
static void dummy_0(void)
{
}
weak_alias(dummy_0, __tl_lock);
weak_alias(dummy_0, __tl_unlock);
static sem_t barrier_sem;
static void bcast_barrier(int s)
{
sem_post(&barrier_se... | src/linux/membarrier.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE 1
#include <sys/mman.h>
#include "syscall.h"
int memfd_create(const char *name, unsigned flags)
{
return syscall(SYS_memfd_create, name, flags);
} | src/linux/memfd_create.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE 1
#include <sys/mman.h>
#include "syscall.h"
int mlock2(const void *addr, size_t len, unsigned flags)
{
if (flags == 0)
return mlock(addr, len);
return syscall(SYS_mlock2, addr, len, flags);
} | src/linux/mlock2.c | null | null | null | null | null |
source | musl | #include "syscall.h"
int init_module(void *a, unsigned long b, const char *c)
{
return syscall(SYS_init_module, a, b, c);
}
int delete_module(const char *a, unsigned b)
{
return syscall(SYS_delete_module, a, b);
} | src/linux/module.c | null | null | null | null | null |
source | musl | #include <sys/mount.h>
#include "syscall.h"
int mount(const char *special, const char *dir, const char *fstype, unsigned long flags, const void *data)
{
return syscall(SYS_mount, special, dir, fstype, flags, data);
}
int umount(const char *special)
{
return syscall(SYS_umount2, special, 0);
}
int umount2(const cha... | src/linux/mount.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <fcntl.h>
#include "syscall.h"
int name_to_handle_at(int dirfd, const char *pathname,
struct file_handle *handle, int *mount_id, int flags)
{
return syscall(SYS_name_to_handle_at, dirfd,
pathname, handle, mount_id, flags);
} | src/linux/name_to_handle_at.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <fcntl.h>
#include "syscall.h"
int open_by_handle_at(int mount_fd, struct file_handle *handle, int flags)
{
return syscall(SYS_open_by_handle_at, mount_fd, handle, flags);
} | src/linux/open_by_handle_at.c | null | null | null | null | null |
source | musl | #include <sys/personality.h>
#include "syscall.h"
#ifdef SYS_personality
int personality(unsigned long persona)
{
return syscall(SYS_personality, persona);
}
#endif | src/linux/personality.c | null | null | null | null | null |
source | musl | #include "syscall.h"
int pivot_root(const char *new, const char *old)
{
return syscall(SYS_pivot_root, new, old);
} | src/linux/pivot_root.c | null | null | null | null | null |
source | musl | #include <sys/prctl.h>
#include <stdarg.h>
#include "syscall.h"
int prctl(int op, ...)
{
unsigned long x[4];
int i;
va_list ap;
va_start(ap, op);
for (i=0; i<4; i++) x[i] = va_arg(ap, unsigned long);
va_end(ap);
return syscall(SYS_prctl, op, x[0], x[1], x[2], x[3]);
} | src/linux/prctl.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sys/uio.h>
#include <unistd.h>
#include "syscall.h"
ssize_t preadv2(int fd, const struct iovec *iov, int count, off_t ofs, int flags)
{
#ifdef SYS_preadv
if (!flags) {
if (ofs==-1) return readv(fd, iov, count);
return syscall_cp(SYS_preadv, fd, iov, count,
(long)(ofs), (long)(ofs>... | src/linux/preadv2.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sys/resource.h>
#include "syscall.h"
#define FIX(x) do{ if ((x)>=SYSCALL_RLIM_INFINITY) (x)=RLIM_INFINITY; }while(0)
int prlimit(pid_t pid, int resource, const struct rlimit *new_limit, struct rlimit *old_limit)
{
struct rlimit tmp;
int r;
if (new_limit && SYSCALL_RLIM_INFINITY != RLI... | src/linux/prlimit.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sys/uio.h>
#include "syscall.h"
ssize_t process_vm_writev(pid_t pid, const struct iovec *lvec, unsigned long liovcnt, const struct iovec *rvec, unsigned long riovcnt, unsigned long flags)
{
return syscall(SYS_process_vm_writev, pid, lvec, liovcnt, rvec, riovcnt, flags);
}
ssize_t proces... | src/linux/process_vm.c | null | null | null | null | null |
source | musl | #include <sys/ptrace.h>
#include <stdarg.h>
#include <unistd.h>
#include "syscall.h"
long ptrace(int req, ...)
{
va_list ap;
pid_t pid;
void *addr, *data, *addr2 = 0;
long ret, result;
va_start(ap, req);
pid = va_arg(ap, pid_t);
addr = va_arg(ap, void *);
data = va_arg(ap, void *);
/* PTRACE_{READ,WRITE}{DAT... | src/linux/ptrace.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sys/uio.h>
#include <unistd.h>
#include "syscall.h"
ssize_t pwritev2(int fd, const struct iovec *iov, int count, off_t ofs, int flags)
{
#ifdef SYS_pwritev
if (!flags) {
if (ofs==-1) return writev(fd, iov, count);
return syscall_cp(SYS_pwritev, fd, iov, count,
(long)(ofs), (long)(... | src/linux/pwritev2.c | null | null | null | null | null |
source | musl | #include <sys/quota.h>
#include "syscall.h"
int quotactl(int cmd, const char *special, int id, char *addr)
{
return syscall(SYS_quotactl, cmd, special, id, addr);
} | src/linux/quotactl.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <fcntl.h>
#include "syscall.h"
ssize_t readahead(int fd, off_t pos, size_t len)
{
return syscall(SYS_readahead, fd, __SYSCALL_LL_O(pos), len);
} | src/linux/readahead.c | null | null | null | null | null |
source | musl | #include <sys/reboot.h>
#include "syscall.h"
int reboot(int type)
{
return syscall(SYS_reboot, 0xfee1dead, 672274793, type);
} | src/linux/reboot.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sys/mman.h>
#include "syscall.h"
int remap_file_pages(void *addr, size_t size, int prot, size_t pgoff, int flags)
{
return syscall(SYS_remap_file_pages, addr, size, prot, pgoff, flags);
} | src/linux/remap_file_pages.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <stdio.h>
#include "syscall.h"
int renameat2(int oldfd, const char *old, int newfd, const char *new, unsigned flags)
{
#ifdef SYS_renameat
if (!flags) return syscall(SYS_renameat, oldfd, old, newfd, new);
#endif
return syscall(SYS_renameat2, oldfd, old, newfd, new, flags);
} | src/linux/renameat2.c | null | null | null | null | null |
source | musl | #define _BSD_SOURCE
#include <unistd.h>
#include <stdint.h>
#include <errno.h>
#include "syscall.h"
void *sbrk(intptr_t inc)
{
if (inc) return (void *)__syscall_ret(-ENOMEM);
return (void *)__syscall(SYS_brk, 0);
} | src/linux/sbrk.c | null | null | null | null | null |
source | musl | #include <sys/sendfile.h>
#include "syscall.h"
ssize_t sendfile(int out_fd, int in_fd, off_t *ofs, size_t count)
{
return syscall(SYS_sendfile, out_fd, in_fd, ofs, count);
} | src/linux/sendfile.c | null | null | null | null | null |
source | musl | #include <sys/fsuid.h>
#include "syscall.h"
int setfsgid(gid_t gid)
{
return syscall(SYS_setfsgid, gid);
} | src/linux/setfsgid.c | null | null | null | null | null |
source | musl | #include <sys/fsuid.h>
#include "syscall.h"
int setfsuid(uid_t uid)
{
return syscall(SYS_setfsuid, uid);
} | src/linux/setfsuid.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <unistd.h>
#include <signal.h>
#include "syscall.h"
#include "libc.h"
struct ctx {
size_t count;
const gid_t *list;
int ret;
};
static void do_setgroups(void *p)
{
struct ctx *c = p;
if (c->ret<0) return;
int ret = __syscall(SYS_setgroups, c->count, c->list);
if (ret && !c->ret) {
... | src/linux/setgroups.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <unistd.h>
#include "syscall.h"
int sethostname(const char *name, size_t len)
{
return syscall(SYS_sethostname, name, len);
} | src/linux/sethostname.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sched.h>
#include "syscall.h"
int setns(int fd, int nstype)
{
return syscall(SYS_setns, fd, nstype);
} | src/linux/setns.c | null | null | null | null | null |
source | musl | #define _BSD_SOURCE
#include <sys/time.h>
#include <time.h>
#include <errno.h>
#include "syscall.h"
int settimeofday(const struct timeval *tv, const struct timezone *tz)
{
if (!tv) return 0;
if (tv->tv_usec >= 1000000ULL) return __syscall_ret(-EINVAL);
return clock_settime(CLOCK_REALTIME, &((struct timespec){
.tv... | src/linux/settimeofday.c | null | null | null | null | null |
source | musl | #include <sys/signalfd.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include "syscall.h"
int signalfd(int fd, const sigset_t *sigs, int flags)
{
int ret = __syscall(SYS_signalfd4, fd, sigs, _NSIG/8, flags);
#ifdef SYS_signalfd
if (ret != -ENOSYS) return __syscall_ret(ret);
ret = __syscall(SYS_signal... | src/linux/signalfd.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <fcntl.h>
#include "syscall.h"
ssize_t splice(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned flags)
{
return syscall(SYS_splice, fd_in, off_in, fd_out, off_out, len, flags);
} | src/linux/splice.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sys/stat.h>
#include <string.h>
#include <syscall.h>
#include <sys/sysmacros.h>
#include <errno.h>
int statx(int dirfd, const char *restrict path, int flags, unsigned mask, struct statx *restrict stx)
{
int ret = __syscall(SYS_statx, dirfd, path, flags, mask, stx);
#ifndef SYS_fstatat
... | src/linux/statx.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <time.h>
#include <sys/time.h>
int stime(const time_t *t)
{
struct timeval tv = { .tv_sec = *t, .tv_usec = 0 };
return settimeofday(&tv, (void *)0);
} | src/linux/stime.c | null | null | null | null | null |
source | musl | #include <sys/swap.h>
#include "syscall.h"
int swapon(const char *path, int flags)
{
return syscall(SYS_swapon, path, flags);
}
int swapoff(const char *path)
{
return syscall(SYS_swapoff, path);
} | src/linux/swap.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <fcntl.h>
#include <errno.h>
#include "syscall.h"
int sync_file_range(int fd, off_t pos, off_t len, unsigned flags)
{
#if defined(SYS_sync_file_range2)
return syscall(SYS_sync_file_range2, fd, flags,
__SYSCALL_LL_E(pos), __SYSCALL_LL_E(len));
#elif defined(SYS_sync_file_range)
return s... | src/linux/sync_file_range.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <unistd.h>
#include "syscall.h"
int syncfs(int fd)
{
return syscall(SYS_syncfs, fd);
} | src/linux/syncfs.c | null | null | null | null | null |
source | musl | #include <sys/sysinfo.h>
#include "syscall.h"
int __lsysinfo(struct sysinfo *info)
{
return syscall(SYS_sysinfo, info);
}
weak_alias(__lsysinfo, sysinfo); | src/linux/sysinfo.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <fcntl.h>
#include "syscall.h"
ssize_t tee(int src, int dest, size_t len, unsigned flags)
{
return syscall(SYS_tee, src, dest, len, flags);
} | src/linux/tee.c | null | null | null | null | null |
source | musl | #include <sys/timerfd.h>
#include <errno.h>
#include "syscall.h"
#define IS32BIT(x) !((x)+0x80000000ULL>>32)
int timerfd_create(int clockid, int flags)
{
return syscall(SYS_timerfd_create, clockid, flags);
}
int timerfd_settime(int fd, int flags, const struct itimerspec *new, struct itimerspec *old)
{
#ifdef SYS_ti... | src/linux/timerfd.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sched.h>
#include "syscall.h"
int unshare(int flags)
{
return syscall(SYS_unshare, flags);
} | src/linux/unshare.c | null | null | null | null | null |
source | musl | #include <sys/time.h>
#include "fcntl.h"
#include "syscall.h"
int utimes(const char *path, const struct timeval times[2])
{
return __futimesat(AT_FDCWD, path, times);
} | src/linux/utimes.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <unistd.h>
#include "syscall.h"
int vhangup(void)
{
return syscall(SYS_vhangup);
} | src/linux/vhangup.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <fcntl.h>
#include "syscall.h"
ssize_t vmsplice(int fd, const struct iovec *iov, size_t cnt, unsigned flags)
{
return syscall(SYS_vmsplice, fd, iov, cnt, flags);
} | src/linux/vmsplice.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sys/wait.h>
#include <sys/resource.h>
#include "syscall.h"
pid_t wait3(int *status, int options, struct rusage *usage)
{
return wait4(-1, status, options, usage);
} | src/linux/wait3.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <sys/wait.h>
#include <sys/resource.h>
#include <string.h>
#include <errno.h>
#include "syscall.h"
pid_t wait4(pid_t pid, int *status, int options, struct rusage *ru)
{
int r;
#ifdef SYS_wait4_time64
if (ru) {
long long kru64[18];
r = __syscall(SYS_wait4_time64, pid, status, options,... | src/linux/wait4.c | null | null | null | null | null |
source | musl | #include <sys/xattr.h>
#include "syscall.h"
ssize_t getxattr(const char *path, const char *name, void *value, size_t size)
{
return syscall(SYS_getxattr, path, name, value, size);
}
ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size)
{
return syscall(SYS_lgetxattr, path, name, value, siz... | src/linux/xattr.c | null | null | null | null | null |
source | musl | #include <sys/sysinfo.h>
#include "syscall.h"
#define klong long long
#define kulong unsigned long long
struct kernel_sysinfo {
klong uptime;
kulong loads[3];
kulong totalram;
kulong freeram;
kulong sharedram;
kulong bufferram;
kulong totalswap;
kulong freeswap;
short procs;
short pad;
kulong totalhigh;
k... | src/linux/x32/sysinfo.c | null | null | null | null | null |
source | musl | #include <locale.h>
#include "locale_impl.h"
static const char *dummy(const char *msg, const struct __locale_map *lm)
{
return msg;
}
weak_alias(dummy, __lctrans_impl);
const char *__lctrans(const char *msg, const struct __locale_map *lm)
{
return __lctrans_impl(msg, lm);
}
const char *__lctrans_cur(const char *m... | src/locale/__lctrans.c | null | null | null | null | null |
source | musl | #include <stdint.h>
#include <string.h>
static inline uint32_t swapc(uint32_t x, int c)
{
return c ? x>>24 | x>>8&0xff00 | x<<8&0xff0000 | x<<24 : x;
}
const char *__mo_lookup(const void *p, size_t size, const char *s)
{
const uint32_t *mo = p;
int sw = *mo - 0x950412de;
uint32_t b = 0, n = swapc(mo[2], sw);
uin... | src/locale/__mo_lookup.c | null | null | null | null | null |
source | musl | 12288,65292,12289,12290,65294,8231,65307,65306,65311,65281,65072,8230,8229,
65104,65105,65106,183,65108,65109,65110,65111,65372,8211,65073,8212,65075,
9588,65076,65103,65288,65289,65077,65078,65371,65373,65079,65080,12308,12309,
65081,65082,12304,12305,65083,65084,12298,12299,65085,65086,12296,12297,65087,
65088,12300,... | src/locale/big5.h | null | null | null | null | null |
source | musl | #include <libintl.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
char *bind_textdomain_codeset(const char *domainname, const char *codeset)
{
if (codeset && strcasecmp(codeset, "UTF-8")) {
errno = EINVAL;
return 0;
}
return "UTF-8";
} | src/locale/bind_textdomain_codeset.c | null | null | null | null | null |
source | musl | #include "locale_impl.h"
#include <stdint.h>
static const uint32_t empty_mo[] = { 0x950412de, 0, -1, -1, -1 };
const struct __locale_map __c_dot_utf8 = {
.map = empty_mo,
.map_size = sizeof empty_mo,
.name = "C.UTF-8"
};
const struct __locale_struct __c_locale = { 0 };
const struct __locale_struct __c_dot_utf8_lo... | src/locale/c_locale.c | null | null | null | null | null |
source | musl | #define _BSD_SOURCE
#include <nl_types.h>
#include <stdint.h>
#include <endian.h>
#include <sys/mman.h>
#define V(p) be32toh(*(uint32_t *)(p))
int catclose (nl_catd catd)
{
char *map = (char *)catd;
munmap(map, V(map+8)+20);
return 0;
} | src/locale/catclose.c | null | null | null | null | null |
source | musl | #define _BSD_SOURCE
#include <nl_types.h>
#include <endian.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#define V(p) be32toh(*(uint32_t *)(p))
static int cmp(const void *a, const void *b)
{
uint32_t x = V(a), y = V(b);
return x<y ? -1 : x>y ? 1 : 0;
}
char *catgets (nl_catd catd, int set_id, int m... | src/locale/catgets.c | null | null | null | null | null |
source | musl | #define _BSD_SOURCE
#include <nl_types.h>
#include <string.h>
#include <stdint.h>
#include <endian.h>
#include <errno.h>
#include <langinfo.h>
#include <locale.h>
#include <sys/mman.h>
#include "libc.h"
#define V(p) be32toh(*(uint32_t *)(p))
static nl_catd do_catopen(const char *name)
{
size_t size;
const unsigned ... | src/locale/catopen.c | null | null | null | null | null |
source | musl | "iso88591\0"
"latin1\0"
"\0\100"
"iso88592\0"
"\0\50"
"\240\20\364\127\116\244\334\364\324\51\250\124\65\125\126\156\265\42\27\134"
"\260\24\24\230\116\264\340\4\225\137\270\130\105\225\126\157\15\66\127\134"
"\111\5\43\214\100\304\314\144\320\61\14\45\143\321\62\30\65\343\214\103"
"\20\355\364\323\64\324\24\145\315\6... | src/locale/codepages.h | null | null | null | null | null |
source | musl | #include <libintl.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <ctype.h>
#include "locale_impl.h"
#include "atomic.h"
#include "pleval.h"
#include "lock.h"
#include "fork_impl.h"
#define malloc __libc_malloc
#define calloc __libc... | src/locale/dcngettext.c | null | null | null | null | null |
source | musl | #include <stdlib.h>
#include <string.h>
#include "locale_impl.h"
#include "libc.h"
#define malloc __libc_malloc
#define calloc undef
#define realloc undef
#define free undef
locale_t __duplocale(locale_t old)
{
locale_t new = malloc(sizeof *new);
if (!new) return 0;
if (old == LC_GLOBAL_LOCALE) old = &libc.global_... | src/locale/duplocale.c | null | null | null | null | null |
source | musl | #include <stdlib.h>
#include "locale_impl.h"
#define malloc undef
#define calloc undef
#define realloc undef
#define free __libc_free
void freelocale(locale_t l)
{
if (__loc_is_allocated(l)) free(l);
}
weak_alias(freelocale, __freelocale); | src/locale/freelocale.c | null | null | null | null | null |
source | musl | 19970,19972,19973,19974,19983,19986,19991,19999,20000,20001,20003,20006,20009,
20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,
20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,
20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,
2009... | src/locale/gb18030.h | null | null | null | null | null |
source | musl | 17392,19506,17923,17830,17784,29287,19831,17843,31921,19682,31941,15253,18230,
18244,19527,19520,17087,13847,29522,28299,28882,19543,41809,18255,17882,19589,
31852,19719,19108,18081,27427,29221,23124,6755,15878,16225,26189,22267,0,
32149,22813,35769,15860,38708,31727,23515,7518,23204,13861,40624,23249,23479,
23804,2647... | src/locale/hkscs.h | null | null | null | null | null |
source | musl | #include <iconv.h>
#include <errno.h>
#include <wchar.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <stdint.h>
#include "locale_impl.h"
#define UTF_32BE 0300
#define UTF_16LE 0301
#define UTF_16BE 0302
#define UTF_32LE 0303
#define UCS2BE 0304
#define UCS2LE 0305
#define... | src/locale/iconv.c | null | null | null | null | null |
source | musl | #include <iconv.h>
#include <stdlib.h>
int iconv_close(iconv_t cd)
{
if (!((size_t)cd & 1)) free((void *)cd);
return 0;
} | src/locale/iconv_close.c | null | null | null | null | null |
source | musl | 12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,
65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,
12295,12540,8213,8208,65295,92,12316,8214,65372,8230,8229,8216,8217,8220,8221,
65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,
12301,12... | src/locale/jis0208.h | null | null | null | null | null |
source | musl | 12288,12289,12290,183,8229,8230,168,12291,173,8213,8741,65340,8764,8216,8217,
8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12304,
12305,177,215,247,8800,8804,8805,8734,8756,176,8242,8243,8451,8491,65504,
65505,65509,9794,9792,8736,8869,8978,8706,8711,8801,8786,167,8251,9734,9733,
9675,9679,9678... | src/locale/ksc.h | null | null | null | null | null |
source | musl | #include <locale.h>
#include <langinfo.h>
#include "locale_impl.h"
static const char c_time[] =
"Sun\0" "Mon\0" "Tue\0" "Wed\0" "Thu\0" "Fri\0" "Sat\0"
"Sunday\0" "Monday\0" "Tuesday\0" "Wednesday\0"
"Thursday\0" "Friday\0" "Saturday\0"
"Jan\0" "Feb\0" "Mar\0" "Apr\0" "May\0" "Jun\0"
"Jul\0" "Aug\0" "Sep\0" "Oct\... | src/locale/langinfo.c | null | null | null | null | null |
source | musl | 256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,
275,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,
296,297,298,299,302,303,304,305,308,309,310,311,312,313,314,315,316,317,318,
321,322,323,324,325,326,327,328,330,331,332,333,336,337,338,339,340,341,342,
343,344,345,... | src/locale/legacychars.h | null | null | null | null | null |
source | musl | #include <locale.h>
#include <string.h>
#include <sys/mman.h>
#include <stdlib.h>
#include "locale_impl.h"
#include "libc.h"
#include "lock.h"
#include "fork_impl.h"
#define malloc __libc_malloc
#define calloc undef
#define realloc undef
#define free undef
const char *__lctrans_impl(const char *msg, const struct __lo... | src/locale/locale_map.c | null | null | null | null | null |
source | musl | #include <locale.h>
#include <limits.h>
static const struct lconv posix_lconv = {
.decimal_point = ".",
.thousands_sep = "",
.grouping = "",
.int_curr_symbol = "",
.currency_symbol = "",
.mon_decimal_point = "",
.mon_thousands_sep = "",
.mon_grouping = "",
.positive_sign = "",
.negative_sign = "",
.int_frac... | src/locale/localeconv.c | null | null | null | null | null |
source | musl | #include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include "locale_impl.h"
#include "lock.h"
#define malloc __libc_malloc
#define calloc undef
#define realloc undef
#define free undef
static int default_locale_init_done;
static struct __locale_struct default_locale, default_ctype_locale;
int __loc_is_allo... | src/locale/newlocale.c | null | null | null | null | null |
source | musl | #include <stdlib.h>
#include <ctype.h>
#include "pleval.h"
/*
grammar:
Start = Expr ';'
Expr = Or | Or '?' Expr ':' Expr
Or = And | Or '||' And
And = Eq | And '&&' Eq
Eq = Rel | Eq '==' Rel | Eq '!=' Rel
Rel = Add | Rel '<=' Add | Rel '>=' Add | Rel '<' Add | Rel '>' Add
Add = Mul | Add '+' Mul | Add '-'... | src/locale/pleval.c | null | null | null | null | null |
source | musl | #ifndef PLEVAL_H
#define PLEVAL_H
#include <features.h>
hidden unsigned long __pleval(const char *, unsigned long);
#endif | src/locale/pleval.h | null | null | null | null | null |
source | musl | 31,80,81,87,14,299,74,61,12,344,62,63,1280,1281,1282,1283,1284,1285,1286,1287,
1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302,
1303,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,
1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1542,1536,1537,1538,1539,
1540,1541,154... | src/locale/revjis.h | null | null | null | null | null |
source | musl | #include <locale.h>
#include <stdlib.h>
#include <string.h>
#include "locale_impl.h"
#include "libc.h"
#include "lock.h"
static char buf[LC_ALL*(LOCALE_NAME_MAX+1)];
char *setlocale(int cat, const char *name)
{
const struct __locale_map *lm;
if ((unsigned)cat > LC_ALL) return 0;
LOCK(__locale_lock);
/* For LC_... | src/locale/setlocale.c | null | null | null | null | null |
source | musl | #include <string.h>
#include <locale.h>
#include "locale_impl.h"
int __strcoll_l(const char *l, const char *r, locale_t loc)
{
return strcmp(l, r);
}
int strcoll(const char *l, const char *r)
{
return __strcoll_l(l, r, CURRENT_LOCALE);
}
weak_alias(__strcoll_l, strcoll_l); | src/locale/strcoll.c | null | null | null | null | null |
source | musl | #include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <monetary.h>
#include <errno.h>
#include "locale_impl.h"
static ssize_t vstrfmon_l(char *s, size_t n, locale_t loc, const char *fmt, va_list ap)
{
size_t l;
double x;
int fill, nogrp, negpar, nosym, left, intl;
int lp, rp, w, fw;
char *s0=s;
for ... | src/locale/strfmon.c | null | null | null | null | null |
source | musl | #define _GNU_SOURCE
#include <stdlib.h>
#include <locale.h>
float strtof_l(const char *restrict s, char **restrict p, locale_t l)
{
return strtof(s, p);
}
double strtod_l(const char *restrict s, char **restrict p, locale_t l)
{
return strtod(s, p);
}
long double strtold_l(const char *restrict s, char **restrict p,... | src/locale/strtod_l.c | null | null | null | null | null |
source | musl | #include <string.h>
#include <locale.h>
#include "locale_impl.h"
/* collate only by code points */
size_t __strxfrm_l(char *restrict dest, const char *restrict src, size_t n, locale_t loc)
{
size_t l = strlen(src);
if (n > l) strcpy(dest, src);
return l;
}
size_t strxfrm(char *restrict dest, const char *restrict s... | src/locale/strxfrm.c | null | null | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.