File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
16
16
([ #448 ] ( https://github.com/nix-rust/nix/pull/448 ) )
17
17
- Added ` getpgid ` in ` ::nix::unistd `
18
18
([ #433 ] ( https://github.com/nix-rust/nix/pull/433 ) )
19
+ - Added ` tcgetpgrp ` and ` tcsetpgrp ` in ` ::nix::unistd `
20
+ ([ #451 ] ( https://github.com/nix-rust/nix/pull/451 ) )
19
21
20
22
### Changed
21
23
- The minimum supported version of rustc is now 1.7.0.
Original file line number Diff line number Diff line change @@ -129,6 +129,28 @@ pub fn setsid() -> Result<pid_t> {
129
129
Errno :: result ( unsafe { libc:: setsid ( ) } )
130
130
}
131
131
132
+
133
+ /// Get the terminal foreground process group (see
134
+ /// [tcgetpgrp(3)](http://man7.org/linux/man-pages/man3/tcgetpgrp.3.html)).
135
+ ///
136
+ /// Get the group process id (GPID) of the foreground process group on the
137
+ /// terminal associated to file descriptor (FD).
138
+ #[ inline]
139
+ pub fn tcgetgrp ( fd : c_int ) -> Result < pid_t > {
140
+ let res = unsafe { libc:: tcgetpgrp ( fd) } ;
141
+ Errno :: result ( res)
142
+ }
143
+ /// Set the terminal foreground process group (see
144
+ /// [tcgetpgrp(3)](http://man7.org/linux/man-pages/man3/tcgetpgrp.3.html)).
145
+ ///
146
+ /// Get the group process id (PGID) to the foreground process group on the
147
+ /// terminal associated to file descriptor (FD).
148
+ #[ inline]
149
+ pub fn tcsetpgrp ( fd : c_int , pgrp : pid_t ) -> Result < ( ) > {
150
+ let res = unsafe { libc:: tcsetpgrp ( fd, pgrp) } ;
151
+ Errno :: result ( res) . map ( drop)
152
+ }
153
+
132
154
/// Get the caller's thread ID (see
133
155
/// [gettid(2)](http://man7.org/linux/man-pages/man2/gettid.2.html).
134
156
///
You can’t perform that action at this time.
0 commit comments