File tree Expand file tree Collapse file tree 6 files changed +55
-10
lines changed Expand file tree Collapse file tree 6 files changed +55
-10
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,12 @@ fn main() {
128
128
129
129
if bsdlike {
130
130
cfg. header ( "sys/event.h" ) ;
131
+
132
+ if freebsd {
133
+ cfg. header ( "libutil.h" ) ;
134
+ } else {
135
+ cfg. header ( "util.h" ) ;
136
+ }
131
137
}
132
138
133
139
if linux {
@@ -136,6 +142,7 @@ fn main() {
136
142
cfg. header ( "sys/xattr.h" ) ;
137
143
cfg. header ( "sys/ipc.h" ) ;
138
144
cfg. header ( "sys/shm.h" ) ;
145
+ cfg. header ( "pty.h" ) ;
139
146
}
140
147
141
148
if linux || android {
@@ -149,7 +156,6 @@ fn main() {
149
156
cfg. header ( "sys/sendfile.h" ) ;
150
157
cfg. header ( "sys/vfs.h" ) ;
151
158
cfg. header ( "sys/syscall.h" ) ;
152
- cfg. header ( "pty.h" ) ;
153
159
if !musl {
154
160
cfg. header ( "linux/netlink.h" ) ;
155
161
cfg. header ( "linux/magic.h" ) ;
Original file line number Diff line number Diff line change @@ -927,6 +927,15 @@ extern {
927
927
len : * mut :: off_t ,
928
928
hdtr : * mut :: sf_hdtr ,
929
929
flags : :: c_int ) -> :: c_int ;
930
+ pub fn openpty ( amaster : * mut :: c_int ,
931
+ aslave : * mut :: c_int ,
932
+ name : * mut :: c_char ,
933
+ termp : * mut termios ,
934
+ winp : * mut :: winsize ) -> :: c_int ;
935
+ pub fn forkpty ( amaster : * mut :: c_int ,
936
+ name : * mut :: c_char ,
937
+ termp : * mut termios ,
938
+ winp : * mut :: winsize ) -> :: pid_t ;
930
939
}
931
940
932
941
cfg_if ! {
Original file line number Diff line number Diff line change @@ -590,6 +590,19 @@ extern {
590
590
flags : :: c_int ) -> :: c_int ;
591
591
}
592
592
593
+ #[ link( name = "util" ) ]
594
+ extern "C" {
595
+ pub fn openpty ( amaster : * mut :: c_int ,
596
+ aslave : * mut :: c_int ,
597
+ name : * mut :: c_char ,
598
+ termp : * mut termios ,
599
+ winp : * mut :: winsize ) -> :: c_int ;
600
+ pub fn forkpty ( amaster : * mut :: c_int ,
601
+ name : * mut :: c_char ,
602
+ termp : * mut termios ,
603
+ winp : * mut :: winsize ) -> :: pid_t ;
604
+ }
605
+
593
606
cfg_if ! {
594
607
if #[ cfg( target_os = "freebsd" ) ] {
595
608
mod freebsd;
Original file line number Diff line number Diff line change @@ -393,6 +393,19 @@ extern {
393
393
pub fn mkostemps ( template : * mut :: c_char , suffixlen : :: c_int , flags : :: c_int ) -> :: c_int ;
394
394
}
395
395
396
+ #[ link( name = "util" ) ]
397
+ extern "C" {
398
+ pub fn openpty ( amaster : * mut :: c_int ,
399
+ aslave : * mut :: c_int ,
400
+ name : * mut :: c_char ,
401
+ termp : * mut termios ,
402
+ winp : * mut :: winsize ) -> :: c_int ;
403
+ pub fn forkpty ( amaster : * mut :: c_int ,
404
+ name : * mut :: c_char ,
405
+ termp : * mut termios ,
406
+ winp : * mut :: winsize ) -> :: pid_t ;
407
+ }
408
+
396
409
cfg_if ! {
397
410
if #[ cfg( target_os = "bitrig" ) ] {
398
411
mod bitrig;
Original file line number Diff line number Diff line change @@ -544,6 +544,19 @@ extern {
544
544
pub fn mkostemps ( template : * mut :: c_char , suffixlen : :: c_int , flags : :: c_int ) -> :: c_int ;
545
545
}
546
546
547
+ #[ link( name = "util" ) ]
548
+ extern "C" {
549
+ pub fn openpty ( amaster : * mut :: c_int ,
550
+ aslave : * mut :: c_int ,
551
+ name : * mut :: c_char ,
552
+ termp : * const termios ,
553
+ winp : * const :: winsize ) -> :: c_int ;
554
+ pub fn forkpty ( amaster : * mut :: c_int ,
555
+ name : * mut :: c_char ,
556
+ termp : * const termios ,
557
+ winp : * const :: winsize ) -> :: pid_t ;
558
+ }
559
+
547
560
cfg_if ! {
548
561
if #[ cfg( any( target_env = "musl" ,
549
562
target_os = "emscripten" ) ) ] {
Original file line number Diff line number Diff line change @@ -655,15 +655,6 @@ extern {
655
655
656
656
pub fn posix_fadvise ( fd : :: c_int , offset : :: off_t , len : :: off_t ,
657
657
advise : :: c_int ) -> :: c_int ;
658
- pub fn openpty ( amaster : * mut :: c_int ,
659
- aslave : * mut :: c_int ,
660
- name : * mut :: c_char ,
661
- termp : * const termios ,
662
- winp : * const :: winsize ) -> :: c_int ;
663
- pub fn forkpty ( amaster : * mut :: c_int ,
664
- name : * mut :: c_char ,
665
- termp : * const termios ,
666
- winp : * const :: winsize ) -> :: pid_t ;
667
658
}
668
659
669
660
cfg_if ! {
You can’t perform that action at this time.
0 commit comments