OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "nacl_io/ossocket.h" | 5 #include "nacl_io/ossocket.h" |
6 #ifdef PROVIDES_SOCKET_API | 6 #ifdef PROVIDES_SOCKET_API |
7 | 7 |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <sys/fcntl.h> | 10 #include <sys/fcntl.h> |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 } | 197 } |
198 | 198 |
199 Error MountNodeSocket::Listen(int backlog) { | 199 Error MountNodeSocket::Listen(int backlog) { |
200 return EOPNOTSUPP; | 200 return EOPNOTSUPP; |
201 } | 201 } |
202 | 202 |
203 Error MountNodeSocket::GetSockOpt(int lvl, | 203 Error MountNodeSocket::GetSockOpt(int lvl, |
204 int optname, | 204 int optname, |
205 void* optval, | 205 void* optval, |
206 socklen_t* len) { | 206 socklen_t* len) { |
207 if (lvl != SOL_SOCKET) | |
208 return EINVAL; | |
209 | |
210 switch (optname) { | |
211 case SO_ERROR: | |
212 if (*len < sizeof(int)) | |
binji
2013/09/30 16:37:48
http://pubs.opengroup.org/onlinepubs/009695399/fun
Sam Clegg
2013/09/30 17:33:25
Done.
| |
213 return EINVAL; | |
214 *static_cast<int*>(optval) = 0; | |
binji
2013/09/30 16:37:48
always 0? This probably needs to be a virtual func
Sam Clegg
2013/09/30 17:33:25
Done.
| |
215 *len = sizeof(int); | |
216 return 0; | |
217 } | |
218 | |
207 return EINVAL; | 219 return EINVAL; |
208 } | 220 } |
209 | 221 |
210 Error MountNodeSocket::SetSockOpt(int lvl, | 222 Error MountNodeSocket::SetSockOpt(int lvl, |
211 int optname, | 223 int optname, |
212 const void* optval, | 224 const void* optval, |
213 socklen_t len) { | 225 socklen_t len) { |
214 return EINVAL; | 226 return EINVAL; |
215 } | 227 } |
216 | 228 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 if (local_addr_ != 0) { | 377 if (local_addr_ != 0) { |
366 *len = ResourceToSockAddr(local_addr_, *len, addr); | 378 *len = ResourceToSockAddr(local_addr_, *len, addr); |
367 return 0; | 379 return 0; |
368 } | 380 } |
369 | 381 |
370 return ENOTCONN; | 382 return ENOTCONN; |
371 } | 383 } |
372 | 384 |
373 } // namespace nacl_io | 385 } // namespace nacl_io |
374 | 386 |
375 #endif // PROVIDES_SOCKET_API | 387 #endif // PROVIDES_SOCKET_API |
OLD | NEW |