Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
libc
Commits
f1ad2f58
Unverified
Commit
f1ad2f58
authored
4 years ago
by
Yuki Okushi
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1717 from jclulow/illumos-cfmakeraw
fix cfmakeraw() for illumos and Solaris
parents
1d9e5fbc
5b6a3335
No related branches found
Branches containing commit
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/unix/solarish/compat.rs
+21
-6
21 additions, 6 deletions
src/unix/solarish/compat.rs
with
21 additions
and
6 deletions
src/unix/solarish/compat.rs
+
21
−
6
View file @
f1ad2f58
...
...
@@ -4,8 +4,7 @@
use
unix
::
solarish
::
*
;
pub
unsafe
fn
cfmakeraw
(
termios
:
*
mut
::
termios
)
{
let
mut
t
=
*
termios
as
::
termios
;
t
.c_iflag
&=
!
(
IMAXBEL
(
*
termios
)
.c_iflag
&=
!
(
IMAXBEL
|
IGNBRK
|
BRKINT
|
PARMRK
...
...
@@ -14,10 +13,26 @@ pub unsafe fn cfmakeraw(termios: *mut ::termios) {
|
IGNCR
|
ICRNL
|
IXON
);
t
.c_oflag
&=
!
OPOST
;
t
.c_lflag
&=
!
(
ECHO
|
ECHONL
|
ICANON
|
ISIG
|
IEXTEN
);
t
.c_cflag
&=
!
(
CSIZE
|
PARENB
);
t
.c_cflag
|
=
CS8
;
(
*
termios
)
.c_oflag
&=
!
OPOST
;
(
*
termios
)
.c_lflag
&=
!
(
ECHO
|
ECHONL
|
ICANON
|
ISIG
|
IEXTEN
);
(
*
termios
)
.c_cflag
&=
!
(
CSIZE
|
PARENB
);
(
*
termios
)
.c_cflag
|
=
CS8
;
// By default, most software expects a pending read to block until at
// least one byte becomes available. As per termio(7I), this requires
// setting the MIN and TIME parameters appropriately.
//
// As a somewhat unfortunate artefact of history, the MIN and TIME slots
// in the control character array overlap with the EOF and EOL slots used
// for canonical mode processing. Because the EOF character needs to be
// the ASCII EOT value (aka Control-D), it has the byte value 4. When
// switching to raw mode, this is interpreted as a MIN value of 4; i.e.,
// reads will block until at least four bytes have been input.
//
// Other platforms with a distinct MIN slot like Linux and FreeBSD appear
// to default to a MIN value of 1, so we'll force that value here:
(
*
termios
)
.c_cc
[
VMIN
]
=
1
;
(
*
termios
)
.c_cc
[
VTIME
]
=
0
;
}
pub
unsafe
fn
cfsetspeed
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment