1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 #include "rust_kernel.h"
15 #include <crt_externs.h>
18 #if defined(__WIN32__)
21 rust_unset_sigprocmask() {
22 // empty stub for windows to keep linker happy
26 rust_set_environ(void* envp) {
27 // empty stub for windows to keep linker happy
30 #elif defined(__GNUC__)
36 extern char **environ;
40 rust_unset_sigprocmask() {
41 // this can't be safely converted to rust code because the
42 // representation of sigset_t is platform-dependent
45 sigprocmask(SIG_SETMASK, &sset, NULL);
49 rust_set_environ(void* envp) {
50 // FIXME: this could actually be converted to rust (see issue #2674)
52 *_NSGetEnviron() = (char **) envp;
54 environ = (char **) envp;
59 #error "Platform not supported."
66 // indent-tabs-mode: nil
68 // buffer-file-coding-system: utf-8-unix
69 // compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";