Commit Graph

1276 Commits

Author SHA1 Message Date
Jon Gjengset
b3700e4364
Blacklist > whitelist 2017-05-03 13:41:00 -04:00
Jon Gjengset
6eb8d1c77c
Treat bitrig and openbsd the same (@semarie) 2017-04-28 23:58:48 -04:00
Jon Gjengset
b8f5838675
OpenBSD also uses res_init like NetBSD? 2017-04-28 22:23:58 -04:00
Jon Gjengset
afebd98131
Android doesn't expose res_init in header file 2017-04-28 22:23:33 -04:00
Jon Gjengset
f93cf62d9a
OpenBSD can't -lresolv, Android shouldn't need it 2017-04-28 17:14:14 -04:00
Jon Gjengset
ef20ddbc57
Add binding for res_init.
Some notes about the particularities of the changes:

res_init has been deprecated in favor of res_ninit, and many (but not
all) targets have therefore renamed the link name to __res_init. For
example, this happened in glibc in version 2.2:
https://bugzilla.redhat.com/show_bug.cgi?id=43822#c6
In these systems, res_init is #defined to __res_init in resolv.h, which
lets existing C programs continue to be compiled.

Unfortunately, this define doesn't automatically apply to our Rust code.
We therefore need to manually map the link name of res_init as
appropriate for each target:

macOS and iOS use res_9_init: 3908694d63/src/libresolv/resolv.h (L316)
Solaris uses res_init: https://java.net/projects/solaris/sources/on-src/content/usr/src/head/resolv.h
OpenBSD uses __res_init: f3b3b7c7ca/include/resolv.h (L268)
FreeBSD uses __res_init: 6911f4a88c/include/resolv.h (L290)
NetBSD uses __res_init: http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/include/resolv.h
glibc uses __res_init: a2f34833b1/resolv/resolv.h (L259)
eglibc uses __res_init: 7f0bcce417/resolv/resolv.h (L259)
musl uses res_init: 0a11d7cb13/include/resolv.h (L128)
Android uses res_init: 306ea55952/libc/include/resolv.h (L57)

One caveat here is that NetBSD doesn't seem to use the symbol name
__res_init yet, despite the redefine being present in resolv.h. At least
Travis fails for the netbsd target if __res_init is used. This may
change in the future.

iOS and macOS both unfortunately require linking with libresolv, despite
the symbols technically being available without libresolv:
resolv: http://blog.achernya.com/2013/03/os-x-has-silly-libsystem.html
Android and OpenBSD fall in the same category.
2017-04-28 10:58:25 -04:00
bors
288ed55dd7 Auto merge of #583 - alexcrichton:bump, r=alexcrichton
Bump to 0.2.22
2017-04-26 20:59:01 +00:00
Alex Crichton
6ef11e694a Bump to 0.2.22 2017-04-26 07:29:19 -07:00
bors
664116073e Auto merge of #582 - mkilgore:sigprocmask, r=alexcrichton
Add sigprocmask function

sigprocmask is currently missing, this adds the definition for sigprocmask into the main list of Unix functions. This should be standard across all the Unix-like systems supported.

Note that the constants for 'how' (SIG_SETMASK, SIG_BLOCK, SIG_UNBLOCK) are already defined, it is only this function that is missing.
2017-04-25 16:03:57 +00:00
bors
26b8ab37c6 Auto merge of #568 - anatol:add_MINSIGSTKSZ, r=alexcrichton
Add MINSIGSTKSZ constant to linux sources

MINSIGSTKSZ is a minimum size of process stack allowed
2017-04-25 09:51:38 +00:00
bors
1a36de91d7 Auto merge of #555 - alexcrichton:retry-appveyor, r=alexcrichton
Surround rustc download in appveyor-retry
2017-04-25 06:18:46 +00:00
Matthew Kilgore
53069830dd Add sigprocmask function 2017-04-25 01:30:14 -04:00
Anatol Pomozov
de75eb6c6a Add MINSIGSTKSZ constant to linux sources
MINSIGSTKSZ is a minimum size of process stack allowed
2017-04-24 12:42:46 -07:00
bors
30d665aef8 Auto merge of #579 - aidanhs:aphs-no-interactive, r=alexcrichton
Remove docker flags that can cause issues

See rust-lang/rust#39036

r? @alexcrichton
2017-04-23 17:52:33 +00:00
Aidan Hobson Sayers
fef01d6513 Remove docker flags that can cause issues (rust-lang/rust#39036) 2017-04-23 17:48:34 +01:00
bors
19fb98d6f1 Auto merge of #577 - malbarbo:pthread_atfork, r=alexcrichton
Add pthread_atfork function
2017-04-20 21:04:14 +00:00
Marco A L Barbosa
9192435999 Add pthread_atfork function 2017-04-20 16:46:40 -03:00
bors
397f851289 Auto merge of #576 - vojtechkral:solaris, r=alexcrichton
Solaris: Add ports support, correct some types, add some errnos

This should benefit Illumos too...
2017-04-20 17:29:08 +00:00
bors
c34a802d1e Auto merge of #572 - malbarbo:android-x86_64, r=alexcrichton
Add x86_64-linux-android support

When rust add support for x86_64-linux-android, the tests may be run with:
`rustup target add x86_64-linux-android && bash ci/run-docker.sh x86_64-linux-android`.

Android x86_64 emulator does not work without hardware acceleration, so we are not able to run tests on travis.
2017-04-20 14:46:39 +00:00
Vojtech Kral
04989f41e9 Solaris: Add support for ports 2017-04-20 16:37:38 +02:00
Vojtech Kral
9e9a32589d Solaris: correct a number of types, add some errnos 2017-04-20 16:36:10 +02:00
bors
9dbdbb1846 Auto merge of #574 - Susurrus:more_constants, r=alexcrichton
More constants

I searched through the codebases for libc and the various platforms to come to these conclusions.
2017-04-20 13:15:36 +00:00
Bryant Mairs
d67c961b2c Expose EXTPROC on Linux/mips 2017-04-19 11:08:52 -07:00
Bryant Mairs
73ca389b04 Expose B460800 & B921600 on netbsd 2017-04-19 11:08:51 -07:00
Bryant Mairs
4cc80979b8 Don't expose B460800 & B921600 on dragonfly
These constants aren't available from the system headers so don't expose
them here.
2017-04-19 11:02:03 -07:00
Bryant Mairs
66bfe09e9e Expose CRTSCTS on freebsd and dragonfly 2017-04-19 10:47:47 -07:00
Bryant Mairs
e71f051fd0 Add IUTF8 to all Linux platforms 2017-04-19 09:22:32 -07:00
Marco A L Barbosa
3ca6ad9a3f Fix x86_64-linux-android failing tests 2017-04-19 12:24:45 -03:00
Marco A L Barbosa
e1c6dedf62 Add test support for x86_64-linux-android 2017-04-19 11:03:19 -03:00
Marco A L Barbosa
0b05b2a845 Enable kvm in docker images if available 2017-04-19 10:59:04 -03:00
bors
81310f5d8f Auto merge of #569 - Norbytus:master, r=alexcrichton
Add const socket protocol for divert rule ipfw on FreeBSD
2017-04-06 16:16:20 +00:00
Norbytus
65b5a5f221 Add const socket protocol for divert rule ipfw on FreeBSD 2017-04-06 17:05:31 +03:00
bors
b821c3ea83 Auto merge of #565 - anatol:master, r=alexcrichton
Link libc crate against pthread

pthread_* functions are defined in libpthread thus we need to link against
this library.
2017-04-05 16:06:34 +00:00
Anatol Pomozov
a763fc5903 Link libc crate against pthread
pthread_* functions are defined in libpthread thus we need to link against
this library.
2017-04-04 13:24:13 -07:00
bors
89aab46099 Auto merge of #559 - superriva:superriva-patch-1, r=alexcrichton
Add IPC,SHM,MSG for Freebsd

              INFO for the patch:
FREEBSD [https://github.com/freebsd/freebsd]

        /sys/sys/_types.h
typedef    long        __key_t;

        /sys/sys/types.h
typedef    __key_t        key_t;

        /sys/sys/ipc.h
#define    IPC_CREAT    001000
#define    IPC_EXCL    002000
#define    IPC_NOWAIT    004000
#define    IPC_PRIVATE    (key_t)0
#define    IPC_RMID    0
#define    IPC_SET     1
#define    IPC_STAT    2
#define    IPC_INFO    3

#define    IPC_R        000400
#define    IPC_W        000200
#define    IPC_M        010000

struct ipc_perm {
    uid_t        cuid;
    gid_t        cgid;
    uid_t        uid;
    gid_t        gid;
    mode_t        mode;
    unsigned short    seq;
    key_t        key;
};

key_t    ftok(const char *, int);

        /sys/sys/msg.h
#define MSG_NOERROR    010000

typedef    unsigned long    msglen_t;
typedef    unsigned long    msgqnum_t;

struct msqid_ds {
	struct	ipc_perm msg_perm;
	struct	msg *msg_first;
	struct	msg *msg_last;
	msglen_t msg_cbytes;
	msgqnum_t msg_qnum;
	msglen_t msg_qbytes;
	pid_t	msg_lspid;
	pid_t	msg_lrpid;
	time_t	msg_stime;
	time_t	msg_rtime;
	time_t	msg_ctime;
};

struct msg {
	struct	msg *msg_next;
	long	msg_type;
	u_short	msg_ts;
	short	msg_spot;
	struct	label *label;
};

struct msginfo {
    int    msgmax,
        msgmni,
        msgmnb,
        msgtql,
        msgssz,
        msgseg;
};

int msgctl(int, int, struct msqid_ds *);
int msgget(key_t, int);
ssize_t msgrcv(int, void *, size_t, long, int);
int msgsnd(int, const void *, size_t, int);

        /sys/sys/shm.h
#define SHM_RDONLY  010000
#define SHM_RND     020000
#define SHMLBA      PAGE_SIZE
#define SHM_R       (IPC_R)
#define SHM_W       (IPC_W)
#define SHM_LOCK    11
#define SHM_UNLOCK  12
#define SHM_STAT    13
#define SHM_INFO    14

typedef unsigned int shmatt_t;

struct shmid_ds {
    struct ipc_perm shm_perm;
    size_t          shm_segsz;
    pid_t           shm_lpid;
    pid_t           shm_cpid;
    shmatt_t        shm_nattch;
    time_t          shm_atime;
    time_t          shm_dtime;
    time_t          shm_ctime;
};

void *shmat(int, const void *, int);
int shmget(key_t, size_t, int);
int shmctl(int, int, struct shmid_ds *);
int shmdt(const void *);

	/sys/security/mac/mac_internal.h
#define	MAC_MAX_SLOTS	4
struct label {
	int		l_flags;
	intptr_t	l_perpolicy[MAC_MAX_SLOTS];
};
2017-04-04 17:35:20 +00:00
superriva
2122616185 Add IPC,SHM,MSG for Freebsd
INFO for the patch:
FREEBSD [https://github.com/freebsd/freebsd]

        /sys/sys/_types.h
typedef    long        __key_t;

        /sys/sys/types.h
typedef    __key_t        key_t;

        /sys/sys/ipc.h

struct ipc_perm {
    uid_t        cuid;
    gid_t        cgid;
    uid_t        uid;
    gid_t        gid;
    mode_t        mode;
    unsigned short    seq;
    key_t        key;
};

key_t    ftok(const char *, int);

        /sys/sys/msg.h

typedef    unsigned long    msglen_t;
typedef    unsigned long    msgqnum_t;

struct msqid_ds {
	struct	ipc_perm msg_perm;
	struct	msg *msg_first;
	struct	msg *msg_last;
	msglen_t msg_cbytes;
	msgqnum_t msg_qnum;
	msglen_t msg_qbytes;
	pid_t	msg_lspid;
	pid_t	msg_lrpid;
	time_t	msg_stime;
	time_t	msg_rtime;
	time_t	msg_ctime;
};

struct msg {
	struct	msg *msg_next;
	long	msg_type;
	u_short	msg_ts;
	short	msg_spot;
	struct	label *label;
};

struct msginfo {
    int    msgmax,
        msgmni,
        msgmnb,
        msgtql,
        msgssz,
        msgseg;
};

int msgctl(int, int, struct msqid_ds *);
int msgget(key_t, int);
ssize_t msgrcv(int, void *, size_t, long, int);
int msgsnd(int, const void *, size_t, int);

        /sys/sys/shm.h

typedef unsigned int shmatt_t;

struct shmid_ds {
    struct ipc_perm shm_perm;
    size_t          shm_segsz;
    pid_t           shm_lpid;
    pid_t           shm_cpid;
    shmatt_t        shm_nattch;
    time_t          shm_atime;
    time_t          shm_dtime;
    time_t          shm_ctime;
};

void *shmat(int, const void *, int);
int shmget(key_t, size_t, int);
int shmctl(int, int, struct shmid_ds *);
int shmdt(const void *);

	/sys/security/mac/mac_internal.h
struct label {
	int		l_flags;
	intptr_t	l_perpolicy[MAC_MAX_SLOTS];
};

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update build.rs

Update mod.rs

Update mod.rs

Update build.rs

Update mod.rs

Update build.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update mod.rs

Update build.rs

Update build.rs

Update mod.rs

Update mod.rs
2017-04-04 10:13:43 +03:00
bors
0203490e9d Auto merge of #567 - amosonn:master, r=alexcrichton
Added O_EXEC, O_SEARCH to solaris and musl, O_PATH to musl.

See #566.
2017-04-04 05:41:19 +00:00
Amos Onn
be1cbaf0b3 Added O_PATH, O_EXEC, O_SEARCH to musl. 2017-04-04 00:42:47 +02:00
Amos Onn
252be4da54 Added O_EXEC and O_SEARCH to solaris libc. 2017-04-04 00:22:32 +02:00
bors
cba41429f2 Auto merge of #564 - vojtechkral:patch-1, r=alexcrichton
Make networking on Solaris/Illumos great again
2017-04-01 00:16:46 +00:00
Vojtech Kral
f4fea9b4a0 Correct sa_family_t on Solaris/Illumos 2017-03-31 22:08:43 +02:00
bors
c6a68f18cb Auto merge of #560 - Mic92:fchown, r=alexcrichton
Add fchown
2017-03-30 20:04:02 +00:00
bors
603e5a79c6 Auto merge of #562 - Mic92:utime, r=alexcrichton
add UTIME_OMIT, UTIME_NOW on linux
2017-03-30 16:45:48 +00:00
Jörg Thalheim
22e79d6781
add UTIME_OMIT, UTIME_NOW on linux 2017-03-30 12:12:06 +02:00
Jörg Thalheim
e6864db83e
add fchown 2017-03-29 20:55:33 +02:00
bors
1033ce707a Auto merge of #558 - Mic92:truncate64, r=alexcrichton
add truncate64/readdir64/openat64 on linux
2017-03-27 15:58:20 +00:00
bors
1d501bc29c Auto merge of #549 - Mic92:atflags, r=alexcrichton
add AT_* constants
2017-03-27 14:25:23 +00:00
Jörg Thalheim
677b08e2ce
add openat64 on linux 2017-03-25 16:03:30 +01:00
Jörg Thalheim
4b6ffe3e30
add readdir64 on linux 2017-03-25 14:11:58 +01:00
Jörg Thalheim
6893609ea8
add truncate64 on linux 2017-03-25 14:04:13 +01:00