]> git.lizzy.rs Git - rust.git/blob - patches/0008-Replace-some-variadic-function-calls-with-unimplemen.patch
Bump serde from 1.0.86 to 1.0.87
[rust.git] / patches / 0008-Replace-some-variadic-function-calls-with-unimplemen.patch
1 From d1d5c0e5272a8c3f78e9c4eb97c38d8f5d5a6d87 Mon Sep 17 00:00:00 2001
2 From: bjorn3 <bjorn3@users.noreply.github.com>
3 Date: Sat, 17 Nov 2018 11:13:19 +0100
4 Subject: [PATCH] Replace some variadic function calls with unimplemented!()
5
6 ---
7  src/libstd/sys/unix/fd.rs     | 18 ++++++++++++++++++
8  src/libstd/sys/unix/fs.rs     | 17 ++++++++++++++++-
9  src/libstd/sys/unix/net.rs    |  3 +++
10  src/libstd/sys/unix/rand.rs   |  3 +++
11  src/libstd/sys/unix/thread.rs |  3 +++
12  5 files changed, 43 insertions(+), 1 deletion(-)
13
14 diff --git a/src/libstd/sys/unix/fd.rs b/src/libstd/sys/unix/fd.rs
15 index 5a81d6d..919f9d1 100644
16 --- a/src/libstd/sys/unix/fd.rs
17 +++ b/src/libstd/sys/unix/fd.rs
18 @@ -156,9 +156,12 @@ impl FileDesc {
19  
20      #[cfg(target_os = "linux")]
21      pub fn get_cloexec(&self) -> io::Result<bool> {
22 +        /*
23          unsafe {
24              Ok((cvt(libc::fcntl(self.fd, libc::F_GETFD))? & libc::FD_CLOEXEC) != 0)
25          }
26 +        */
27 +        unimplemented!();
28      }
29  
30      #[cfg(not(any(target_env = "newlib",
31 @@ -168,10 +171,13 @@ impl FileDesc {
32                    target_os = "l4re",
33                    target_os = "haiku")))]
34      pub fn set_cloexec(&self) -> io::Result<()> {
35 +        /*
36          unsafe {
37              cvt(libc::ioctl(self.fd, libc::FIOCLEX))?;
38              Ok(())
39          }
40 +        */
41 +        unimplemented!();
42      }
43      #[cfg(any(target_env = "newlib",
44                target_os = "solaris",
45 @@ -180,6 +186,7 @@ impl FileDesc {
46                target_os = "l4re",
47                target_os = "haiku"))]
48      pub fn set_cloexec(&self) -> io::Result<()> {
49 +        /*
50          unsafe {
51              let previous = cvt(libc::fcntl(self.fd, libc::F_GETFD))?;
52              let new = previous | libc::FD_CLOEXEC;
53 @@ -188,19 +195,25 @@ impl FileDesc {
54              }
55              Ok(())
56          }
57 +        */
58 +        unimplemented!();
59      }
60  
61      #[cfg(target_os = "linux")]
62      pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
63 +        /*
64          unsafe {
65              let v = nonblocking as c_int;
66              cvt(libc::ioctl(self.fd, libc::FIONBIO, &v))?;
67              Ok(())
68          }
69 +        */
70 +        unimplemented!();
71      }
72  
73      #[cfg(not(target_os = "linux"))]
74      pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
75 +        /*
76          unsafe {
77              let previous = cvt(libc::fcntl(self.fd, libc::F_GETFL))?;
78              let new = if nonblocking {
79 @@ -213,9 +226,12 @@ impl FileDesc {
80              }
81              Ok(())
82          }
83 +        */
84 +        unimplemented!();
85      }
86  
87      pub fn duplicate(&self) -> io::Result<FileDesc> {
88 +        /*
89          // We want to atomically duplicate this file descriptor and set the
90          // CLOEXEC flag, and currently that's done via F_DUPFD_CLOEXEC. This
91          // flag, however, isn't supported on older Linux kernels (earlier than
92 @@ -263,6 +279,8 @@ impl FileDesc {
93              }
94          }
95          cvt(unsafe { libc::fcntl(fd, libc::F_DUPFD, 0) }).and_then(make_filedesc)
96 +        */
97 +        unimplemented!();
98      }
99  }
100  
101 diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
102 index add06ae..1a392fc 100644
103 --- a/src/libstd/sys/unix/fs.rs
104 +++ b/src/libstd/sys/unix/fs.rs
105 @@ -465,6 +465,7 @@ impl File {
106      }
107  
108      pub fn open_c(path: &CStr, opts: &OpenOptions) -> io::Result<File> {
109 +        /*
110          let flags = libc::O_CLOEXEC |
111                      opts.get_access_mode()? |
112                      opts.get_creation_mode()? |
113 @@ -519,6 +520,8 @@ impl File {
114  
115          ensure_cloexec(&fd)?;
116          Ok(File(fd))
117 +        */
118 +        unimplemented!();
119      }
120  
121      pub fn file_attr(&self) -> io::Result<FileAttr> {
122 @@ -535,6 +538,7 @@ impl File {
123      }
124  
125      pub fn datasync(&self) -> io::Result<()> {
126 +        /*
127          cvt_r(|| unsafe { os_datasync(self.0.raw()) })?;
128          return Ok(());
129  
130 @@ -547,7 +551,9 @@ impl File {
131          #[cfg(not(any(target_os = "macos",
132                        target_os = "ios",
133                        target_os = "linux")))]
134 -        unsafe fn os_datasync(fd: c_int) -> c_int { libc::fsync(fd) }
135 +        unsafe fn os_datasync(fd: c_int) -> c_int { libc::fsync(fd) }]
136 +        */
137 +        unimplemented!();
138      }
139  
140      pub fn truncate(&self, size: u64) -> io::Result<()> {
141 @@ -643,6 +649,7 @@ impl fmt::Debug for File {
142  
143          #[cfg(target_os = "macos")]
144          fn get_path(fd: c_int) -> Option<PathBuf> {
145 +            /*
146              // FIXME: The use of PATH_MAX is generally not encouraged, but it
147              // is inevitable in this case because macOS defines `fcntl` with
148              // `F_GETPATH` in terms of `MAXPATHLEN`, and there are no
149 @@ -657,6 +664,8 @@ impl fmt::Debug for File {
150              buf.truncate(l as usize);
151              buf.shrink_to_fit();
152              Some(PathBuf::from(OsString::from_vec(buf)))
153 +            */
154 +            unimplemented!();
155          }
156  
157          #[cfg(not(any(target_os = "linux", target_os = "macos")))]
158 @@ -667,6 +676,7 @@ impl fmt::Debug for File {
159  
160          #[cfg(any(target_os = "linux", target_os = "macos"))]
161          fn get_mode(fd: c_int) -> Option<(bool, bool)> {
162 +            /*
163              let mode = unsafe { libc::fcntl(fd, libc::F_GETFL) };
164              if mode == -1 {
165                  return None;
166 @@ -677,6 +687,8 @@ impl fmt::Debug for File {
167                  libc::O_WRONLY => Some((false, true)),
168                  _ => None
169              }
170 +            */
171 +            unimplemented!();
172          }
173  
174          #[cfg(not(any(target_os = "linux", target_os = "macos")))]
175 @@ -868,6 +880,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
176          len: libc::size_t,
177          flags: libc::c_uint,
178      ) -> libc::c_long {
179 +        /*
180          libc::syscall(
181              libc::SYS_copy_file_range,
182              fd_in,
183 @@ -877,6 +890,8 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
184              len,
185              flags,
186          )
187 +        */
188 +        unimplemented!();
189      }
190  
191      if !from.is_file() {
192 diff --git a/src/libstd/sys/unix/net.rs b/src/libstd/sys/unix/net.rs
193 index 2d10541..19e96c4 100644
194 --- a/src/libstd/sys/unix/net.rs
195 +++ b/src/libstd/sys/unix/net.rs
196 @@ -339,8 +339,11 @@ impl Socket {
197      }
198  
199      pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
200 +        /*
201          let mut nonblocking = nonblocking as libc::c_int;
202          cvt(unsafe { libc::ioctl(*self.as_inner(), libc::FIONBIO, &mut nonblocking) }).map(|_| ())
203 +        */
204 +        unimplemented!();
205      }
206  
207      pub fn take_error(&self) -> io::Result<Option<io::Error>> {
208 diff --git a/src/libstd/sys/unix/rand.rs b/src/libstd/sys/unix/rand.rs
209 index 371e58a..28d4c68 100644
210 --- a/src/libstd/sys/unix/rand.rs
211 +++ b/src/libstd/sys/unix/rand.rs
212 @@ -34,9 +34,12 @@ mod imp {
213  
214      #[cfg(any(target_os = "linux", target_os = "android"))]
215      fn getrandom(buf: &mut [u8]) -> libc::c_long {
216 +        /*
217          unsafe {
218              libc::syscall(libc::SYS_getrandom, buf.as_mut_ptr(), buf.len(), libc::GRND_NONBLOCK)
219          }
220 +        */
221 +        unimplemented!();
222      }
223  
224      #[cfg(not(any(target_os = "linux", target_os = "android")))]
225 diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs
226 index f3a45d2..1c2f0ce 100644
227 --- a/src/libstd/sys/unix/thread.rs
228 +++ b/src/libstd/sys/unix/thread.rs
229 @@ -100,12 +100,15 @@ impl Thread {
230      #[cfg(any(target_os = "linux",
231                target_os = "android"))]
232      pub fn set_name(name: &CStr) {
233 +        /*
234          const PR_SET_NAME: libc::c_int = 15;
235          // pthread wrapper only appeared in glibc 2.12, so we use syscall
236          // directly.
237          unsafe {
238              libc::prctl(PR_SET_NAME, name.as_ptr() as libc::c_ulong, 0, 0, 0);
239          }
240 +        */
241 +        unimplemented!();
242      }
243  
244      #[cfg(any(target_os = "freebsd",
245 -- 
246 2.17.2 (Apple Git-113)
247