1
- //! Hacking together the definitions for VxWorks Bindings
1
+ //! Interface to VxWorks C library
2
+
2
3
use core:: mem:: size_of;
3
4
use core:: ptr:: null_mut;
4
5
188
189
pub __ss_pad2 : [ :: c_char; 32 ] ,
189
190
pub __ss_pad3 : [ :: c_char; 32 ] ,
190
191
pub __ss_pad4 : [ :: c_char; 32 ] ,
191
- pub __ss_pad5 : [ :: c_char; 32 ] ,
192
+ pub __ss_pad5 : [ :: c_char; _SS_PAD2SIZE - 96 ] ,
192
193
}
193
194
pub struct iovec {
194
195
pub iov_base: * mut :: c_void,
@@ -963,15 +964,7 @@ extern {
963
964
pub fn isxdigit ( c : c_int ) -> c_int ;
964
965
pub fn tolower ( c : c_int ) -> c_int ;
965
966
pub fn toupper ( c : c_int ) -> c_int ;
966
- #[ cfg_attr(
967
- all( target_os = "macos" , target_arch = "x86" ) ,
968
- link_name = "fopen$UNIX2003"
969
- ) ]
970
967
pub fn fopen ( filename : * const c_char , mode : * const c_char ) -> * mut FILE ;
971
- #[ cfg_attr(
972
- all( target_os = "macos" , target_arch = "x86" ) ,
973
- link_name = "freopen$UNIX2003"
974
- ) ]
975
968
pub fn freopen (
976
969
filename : * const c_char ,
977
970
mode : * const c_char ,
@@ -995,10 +988,6 @@ extern {
995
988
pub fn fgets ( buf : * mut c_char , n : c_int , stream : * mut FILE )
996
989
-> * mut c_char ;
997
990
pub fn fputc ( c : c_int , stream : * mut FILE ) -> c_int ;
998
- #[ cfg_attr(
999
- all( target_os = "macos" , target_arch = "x86" ) ,
1000
- link_name = "fputs$UNIX2003"
1001
- ) ]
1002
991
pub fn fputs ( s : * const c_char , stream : * mut FILE ) -> c_int ;
1003
992
pub fn puts ( s : * const c_char ) -> c_int ;
1004
993
pub fn ungetc ( c : c_int , stream : * mut FILE ) -> c_int ;
@@ -1008,10 +997,6 @@ extern {
1008
997
nobj : size_t ,
1009
998
stream : * mut FILE ,
1010
999
) -> size_t ;
1011
- #[ cfg_attr(
1012
- all( target_os = "macos" , target_arch = "x86" ) ,
1013
- link_name = "fwrite$UNIX2003"
1014
- ) ]
1015
1000
pub fn fwrite (
1016
1001
ptr : * const c_void ,
1017
1002
size : size_t ,
@@ -1021,18 +1006,12 @@ extern {
1021
1006
pub fn fseek ( stream : * mut FILE , offset : c_long , whence : c_int ) -> c_int ;
1022
1007
pub fn ftell ( stream : * mut FILE ) -> c_long ;
1023
1008
pub fn rewind ( stream : * mut FILE ) ;
1024
- #[ cfg_attr( target_os = "netbsd" , link_name = "__fgetpos50" ) ]
1025
1009
pub fn fgetpos ( stream : * mut FILE , ptr : * mut fpos_t ) -> c_int ;
1026
- #[ cfg_attr( target_os = "netbsd" , link_name = "__fsetpos50" ) ]
1027
1010
pub fn fsetpos ( stream : * mut FILE , ptr : * const fpos_t ) -> c_int ;
1028
1011
pub fn feof ( stream : * mut FILE ) -> c_int ;
1029
1012
pub fn ferror ( stream : * mut FILE ) -> c_int ;
1030
1013
pub fn perror ( s : * const c_char ) ;
1031
1014
pub fn atoi ( s : * const c_char ) -> c_int ;
1032
- #[ cfg_attr(
1033
- all( target_os = "macos" , target_arch = "x86" ) ,
1034
- link_name = "strtod$UNIX2003"
1035
- ) ]
1036
1015
pub fn strtod ( s : * const c_char , endp : * mut * mut c_char ) -> c_double ;
1037
1016
pub fn strtol (
1038
1017
s : * const c_char ,
@@ -1052,10 +1031,6 @@ extern {
1052
1031
pub fn exit ( status : c_int ) -> !;
1053
1032
// pub fn _exit(status: c_int) -> !;
1054
1033
pub fn atexit ( cb : extern fn ( ) ) -> c_int ;
1055
- #[ cfg_attr(
1056
- all( target_os = "macos" , target_arch = "x86" ) ,
1057
- link_name = "system$UNIX2003"
1058
- ) ]
1059
1034
pub fn system ( s : * const c_char ) -> c_int ;
1060
1035
pub fn getenv ( s : * const c_char ) -> * mut c_char ;
1061
1036
@@ -1089,10 +1064,6 @@ extern {
1089
1064
) -> c_int ;
1090
1065
pub fn strlen ( cs : * const c_char ) -> size_t ;
1091
1066
pub fn strnlen ( cs : * const c_char , maxlen : size_t ) -> size_t ;
1092
- #[ cfg_attr(
1093
- all( target_os = "macos" , target_arch = "x86" ) ,
1094
- link_name = "strerror$UNIX2003"
1095
- ) ]
1096
1067
pub fn strerror ( n : c_int ) -> * mut c_char ;
1097
1068
pub fn strtok ( s : * mut c_char , t : * const c_char ) -> * mut c_char ;
1098
1069
pub fn strxfrm ( s : * mut c_char , ct : * const c_char , n : size_t ) -> size_t ;
@@ -1119,9 +1090,7 @@ extern {
1119
1090
}
1120
1091
1121
1092
extern {
1122
- #[ cfg_attr( target_os = "netbsd" , link_name = "__getpwnam50" ) ]
1123
1093
pub fn getpwnam ( name : * const :: c_char ) -> * mut passwd ;
1124
- #[ cfg_attr( target_os = "netbsd" , link_name = "__getpwuid50" ) ]
1125
1094
pub fn getpwuid ( uid : :: uid_t ) -> * mut passwd ;
1126
1095
1127
1096
pub fn fprintf (
@@ -1147,29 +1116,12 @@ extern {
1147
1116
-> :: c_int ;
1148
1117
pub fn getchar_unlocked ( ) -> :: c_int ;
1149
1118
pub fn putchar_unlocked ( c : :: c_int ) -> :: c_int ;
1150
-
1151
1119
pub fn stat ( path : * const c_char , buf : * mut stat ) -> :: c_int ;
1152
-
1153
1120
pub fn pclose ( stream : * mut :: FILE ) -> :: c_int ;
1154
- #[ cfg_attr(
1155
- all( target_os = "macos" , target_arch = "x86" ) ,
1156
- link_name = "fdopen$UNIX2003"
1157
- ) ]
1158
1121
pub fn fdopen ( fd : :: c_int , mode : * const c_char ) -> * mut :: FILE ;
1159
1122
pub fn fileno ( stream : * mut :: FILE ) -> :: c_int ;
1160
-
1161
- #[ cfg_attr(
1162
- all( target_os = "macos" , target_arch = "x86" ) ,
1163
- link_name = "open$UNIX2003"
1164
- ) ]
1165
- #[ cfg_attr(
1166
- all( target_os = "macos" , target_arch = "x86" ) ,
1167
- link_name = "creat$UNIX2003"
1168
- ) ]
1169
1123
pub fn creat ( path : * const c_char , mode : mode_t ) -> :: c_int ;
1170
-
1171
1124
pub fn fdopendir ( fd : :: c_int ) -> * mut :: DIR ;
1172
-
1173
1125
pub fn rewinddir ( dirp : * mut :: DIR ) ;
1174
1126
1175
1127
pub fn openat (
@@ -1192,8 +1144,6 @@ extern {
1192
1144
group : :: gid_t ,
1193
1145
flags : :: c_int ,
1194
1146
) -> :: c_int ;
1195
- #[ cfg_attr( target_os = "macos" , link_name = "fstatat$INODE64" ) ]
1196
- #[ cfg_attr( target_os = "freebsd" , link_name = "fstatat@FBSD_1.1" ) ]
1197
1147
pub fn fstatat (
1198
1148
dirfd : :: c_int ,
1199
1149
pathname : * const :: c_char ,
@@ -1234,10 +1184,6 @@ extern {
1234
1184
pub fn alarm ( seconds : :: c_uint ) -> :: c_uint ;
1235
1185
pub fn fchdir ( dirfd : :: c_int ) -> :: c_int ;
1236
1186
pub fn chown ( path : * const c_char , uid : uid_t , gid : gid_t ) -> :: c_int ;
1237
- #[ cfg_attr(
1238
- all( target_os = "macos" , target_arch = "x86" ) ,
1239
- link_name = "lchown$UNIX2003"
1240
- ) ]
1241
1187
pub fn lchown ( path : * const c_char , uid : uid_t , gid : gid_t ) -> :: c_int ;
1242
1188
pub fn execl ( path : * const c_char , arg0 : * const c_char , ...) -> :: c_int ;
1243
1189
pub fn execle (
@@ -1282,39 +1228,13 @@ extern {
1282
1228
pub fn tcsetpgrp ( fd : :: c_int , pgrp : :: pid_t ) -> :: c_int ;
1283
1229
pub fn ttyname ( fd : :: c_int ) -> * mut c_char ;
1284
1230
pub fn wait ( status : * mut :: c_int ) -> pid_t ;
1285
- /*
1286
- pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t,
1287
- offset: off_t) -> ::ssize_t;
1288
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1289
- link_name = "pwrite$UNIX2003")]
1290
- pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t,
1291
- offset: off_t) -> ::ssize_t;
1292
- */
1293
1231
pub fn umask ( mask : mode_t ) -> mode_t ;
1294
-
1295
- // #[cfg_attr(target_os = "netbsd", link_name = "__utime50")]
1296
- // pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int;
1297
-
1298
- /*
1299
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1300
- link_name = "kill$UNIX2003")]
1301
- pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int;
1302
- */
1303
- #[ cfg_attr(
1304
- all( target_os = "macos" , target_arch = "x86" ) ,
1305
- link_name = "killpg$UNIX2003"
1306
- ) ]
1307
1232
pub fn killpg ( pgrp : pid_t , sig : :: c_int ) -> :: c_int ;
1308
-
1309
1233
pub fn mlock ( addr : * const :: c_void , len : :: size_t ) -> :: c_int ;
1310
1234
pub fn munlock ( addr : * const :: c_void , len : :: size_t ) -> :: c_int ;
1311
1235
pub fn mlockall ( flags : :: c_int ) -> :: c_int ;
1312
1236
pub fn munlockall ( ) -> :: c_int ;
1313
1237
1314
- #[ cfg_attr(
1315
- all( target_os = "macos" , target_arch = "x86" ) ,
1316
- link_name = "mmap$UNIX2003"
1317
- ) ]
1318
1238
pub fn mmap (
1319
1239
addr : * mut :: c_void ,
1320
1240
len : :: size_t ,
@@ -1323,10 +1243,6 @@ extern {
1323
1243
fd : :: c_int ,
1324
1244
offset : off_t ,
1325
1245
) -> * mut :: c_void ;
1326
- #[ cfg_attr(
1327
- all( target_os = "macos" , target_arch = "x86" ) ,
1328
- link_name = "munmap$UNIX2003"
1329
- ) ]
1330
1246
pub fn munmap ( addr : * mut :: c_void , len : :: size_t ) -> :: c_int ;
1331
1247
1332
1248
pub fn if_nametoindex ( ifname : * const c_char ) -> :: c_uint ;
@@ -1337,28 +1253,10 @@ extern {
1337
1253
1338
1254
pub fn truncate ( path : * const c_char , length : off_t ) -> :: c_int ;
1339
1255
1340
- #[ cfg_attr(
1341
- all( target_os = "macos" , target_arch = "x86" ) ,
1342
- link_name = "getrlimit$UNIX2003"
1343
- ) ]
1344
1256
pub fn getrlimit ( resource : :: c_int , rlim : * mut rlimit ) -> :: c_int ;
1345
- #[ cfg_attr(
1346
- all( target_os = "macos" , target_arch = "x86" ) ,
1347
- link_name = "setrlimit$UNIX2003"
1348
- ) ]
1349
1257
pub fn setrlimit ( resource : :: c_int , rlim : * const rlimit ) -> :: c_int ;
1350
- // #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")]
1351
- // pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
1352
-
1353
- /*
1354
- #[cfg_attr(any(target_os = "macos", target_os = "ios"),
1355
- link_name = "realpath$DARWIN_EXTSN")]
1356
- pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char)
1357
- -> *mut ::c_char;
1358
- */
1359
1258
pub fn flock ( fd : :: c_int , operation : :: c_int ) -> :: c_int ;
1360
1259
1361
- #[ cfg_attr( target_os = "netbsd" , link_name = "__gettimeofday50" ) ]
1362
1260
pub fn gettimeofday ( tp : * mut :: timeval , tz : * mut :: c_void ) -> :: c_int ;
1363
1261
pub fn pthread_exit ( value : * mut :: c_void ) ;
1364
1262
pub fn pthread_attr_setdetachstate (
@@ -1378,7 +1276,6 @@ extern {
1378
1276
oldact : * mut sigaction ,
1379
1277
) -> :: c_int ;
1380
1278
1381
- #[ cfg_attr( target_os = "netbsd" , link_name = "__utimes50" ) ]
1382
1279
pub fn utimes (
1383
1280
filename : * const :: c_char ,
1384
1281
times : * const :: timeval ,
@@ -1391,67 +1288,27 @@ extern {
1391
1288
) -> * mut :: c_void ;
1392
1289
pub fn dlclose ( handle : * mut :: c_void ) -> :: c_int ;
1393
1290
pub fn res_init ( ) -> :: c_int ;
1394
- /*
1395
- #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
1396
- pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
1397
- #[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")]
1398
- pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
1399
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1400
- link_name = "mktime$UNIX2003")]
1401
- #[cfg_attr(target_os = "netbsd", link_name = "__mktime50")]
1402
- pub fn mktime(tm: *mut tm) -> time_t;
1403
- #[cfg_attr(target_os = "netbsd", link_name = "__time50")]
1404
- pub fn time(time: *mut time_t) -> time_t;
1405
- #[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")]
1406
- pub fn gmtime(time_p: *const time_t) -> *mut tm;
1407
- #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")]
1408
- pub fn localtime(time_p: *const time_t) -> *mut tm;
1409
- */
1410
- #[ cfg_attr( target_os = "netbsd" , link_name = "__difftime50" ) ]
1411
1291
pub fn difftime ( time1 : time_t , time0 : time_t ) -> :: c_double ;
1412
1292
1413
- #[ cfg_attr( target_os = "netbsd" , link_name = "__mknod50" ) ]
1414
- #[ cfg_attr( target_os = "freebsd" , link_name = "mknod@FBSD_1.0" ) ]
1415
1293
pub fn mknod (
1416
1294
pathname : * const :: c_char ,
1417
1295
mode : :: mode_t ,
1418
1296
dev : :: dev_t ,
1419
1297
) -> :: c_int ;
1420
1298
pub fn gethostname ( name : * mut :: c_char , len : :: size_t ) -> :: c_int ;
1421
- // pub fn getservbyname(name: *const ::c_char,
1422
- // proto: *const ::c_char) -> *mut servent;
1423
- // pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
1424
- // pub fn getprotobynumber(proto: ::c_int) -> *mut protoent;
1425
1299
pub fn chroot ( name : * const :: c_char ) -> :: c_int ;
1426
- #[ cfg_attr(
1427
- all( target_os = "macos" , target_arch = "x86" ) ,
1428
- link_name = "usleep$UNIX2003"
1429
- ) ]
1430
1300
pub fn usleep ( secs : :: c_uint ) -> :: c_int ;
1431
- #[ cfg_attr(
1432
- all( target_os = "macos" , target_arch = "x86" ) ,
1433
- link_name = "putenv$UNIX2003"
1434
- ) ]
1435
1301
pub fn putenv ( string : * mut c_char ) -> :: c_int ;
1436
- #[ cfg_attr( target_os = "netbsd" , link_name = "__select50" ) ]
1437
- // pub fn select(nfds: ::c_int,
1438
- // readfs: *mut fd_set,
1439
- // writefds: *mut fd_set,
1440
- // errorfds: *mut fd_set,
1441
- // timeout: *mut timeval) -> ::c_int;
1442
- #[ cfg_attr( target_os = "netbsd" , link_name = "__setlocale50" ) ]
1443
1302
pub fn setlocale (
1444
1303
category : :: c_int ,
1445
1304
locale : * const :: c_char ,
1446
1305
) -> * mut :: c_char ;
1447
- // pub fn localeconv() -> *mut lconv;
1448
1306
1449
1307
pub fn sigprocmask (
1450
1308
how : :: c_int ,
1451
1309
set : * const sigset_t ,
1452
1310
oldset : * mut sigset_t ,
1453
1311
) -> :: c_int ;
1454
- #[ cfg_attr( target_os = "netbsd" , link_name = "__sigpending14" ) ]
1455
1312
pub fn sigpending ( set : * mut sigset_t ) -> :: c_int ;
1456
1313
1457
1314
pub fn getsid ( pid : pid_t ) -> pid_t ;
@@ -1464,10 +1321,6 @@ extern {
1464
1321
whence : :: c_int ,
1465
1322
) -> :: c_int ;
1466
1323
pub fn ftello ( stream : * mut :: FILE ) -> :: off_t ;
1467
- #[ cfg_attr(
1468
- all( target_os = "macos" , target_arch = "x86" ) ,
1469
- link_name = "tcdrain$UNIX2003"
1470
- ) ]
1471
1324
pub fn tcdrain ( fd : :: c_int ) -> :: c_int ;
1472
1325
pub fn tcflow ( fd : :: c_int , action : :: c_int ) -> :: c_int ;
1473
1326
pub fn tcflush ( fd : :: c_int , action : :: c_int ) -> :: c_int ;
@@ -1481,12 +1334,7 @@ extern {
1481
1334
pub fn openlog ( ident : * const :: c_char , logopt : :: c_int , facility : :: c_int ) ;
1482
1335
pub fn closelog ( ) ;
1483
1336
pub fn setlogmask ( maskpri : :: c_int ) -> :: c_int ;
1484
- #[ cfg_attr( target_os = "macos" , link_name = "syslog$DARWIN_EXTSN" ) ]
1485
1337
pub fn syslog ( priority : :: c_int , message : * const :: c_char , ...) ;
1486
- #[ cfg_attr(
1487
- all( target_os = "macos" , target_arch = "x86" ) ,
1488
- link_name = "nice$UNIX2003"
1489
- ) ]
1490
1338
pub fn nice ( incr : :: c_int ) -> :: c_int ;
1491
1339
1492
1340
pub fn grantpt ( fd : :: c_int ) -> :: c_int ;
@@ -2141,6 +1989,7 @@ extern {
2141
1989
pub fn raise ( __signo : :: c_int ) -> :: c_int ;
2142
1990
// taskLibCommon.h
2143
1991
pub fn taskIdSelf ( ) -> :: TASK_ID ;
1992
+ pub fn taskDelay ( ticks : :: _Vx_ticks_t ) -> :: c_int ;
2144
1993
2145
1994
// rtpLibCommon.h
2146
1995
pub fn rtpInfoGet ( rtpId : :: RTP_ID , rtpStruct : * mut :: RTP_DESC ) -> :: c_int ;
@@ -2167,6 +2016,12 @@ extern {
2167
2016
iov : * const :: iovec ,
2168
2017
iovcnt : :: c_int ,
2169
2018
) -> :: ssize_t ;
2019
+
2020
+ // randomNumGen.h
2021
+ pub fn randBytes ( buf : * mut c_uchar , length : c_int ) -> c_int ;
2022
+ pub fn randABytes ( buf : * mut c_uchar , length : c_int ) -> c_int ;
2023
+ pub fn randUBytes ( buf : * mut c_uchar , length : c_int ) -> c_int ;
2024
+ pub fn randSecure ( ) -> c_int ;
2170
2025
}
2171
2026
2172
2027
pub fn dladdr ( addr : * const :: c_void , info : * mut Dl_info ) -> :: c_int {
0 commit comments