Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
relibc
Commits
307cd568
Commit
307cd568
authored
4 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-tcsetattr' into 'master'
Handle TCSETSW and TCSETSF in ioctl Closes
#168
See merge request
!324
parents
7ed74c8c
49e3e44b
No related branches found
No related tags found
1 merge request
!324
Handle TCSETSW and TCSETSF in ioctl
Pipeline
#9178
passed with warnings
4 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/header/sys_ioctl/redox.rs
+6
-1
6 additions, 1 deletion
src/header/sys_ioctl/redox.rs
with
6 additions
and
1 deletion
src/header/sys_ioctl/redox.rs
+
6
−
1
View file @
307cd568
...
@@ -12,6 +12,8 @@ pub const FIONBIO: c_ulong = 0x5421;
...
@@ -12,6 +12,8 @@ pub const FIONBIO: c_ulong = 0x5421;
pub
const
TCGETS
:
c_ulong
=
0x5401
;
pub
const
TCGETS
:
c_ulong
=
0x5401
;
pub
const
TCSETS
:
c_ulong
=
0x5402
;
pub
const
TCSETS
:
c_ulong
=
0x5402
;
pub
const
TCSETSW
:
c_ulong
=
0x5403
;
pub
const
TCSETSF
:
c_ulong
=
0x5404
;
pub
const
TCSBRK
:
c_ulong
=
0x5409
;
pub
const
TCSBRK
:
c_ulong
=
0x5409
;
pub
const
TCXONC
:
c_ulong
=
0x540A
;
pub
const
TCXONC
:
c_ulong
=
0x540A
;
...
@@ -24,6 +26,8 @@ pub const TIOCSPGRP: c_ulong = 0x5410;
...
@@ -24,6 +26,8 @@ pub const TIOCSPGRP: c_ulong = 0x5410;
pub
const
TIOCGWINSZ
:
c_ulong
=
0x5413
;
pub
const
TIOCGWINSZ
:
c_ulong
=
0x5413
;
pub
const
TIOCSWINSZ
:
c_ulong
=
0x5414
;
pub
const
TIOCSWINSZ
:
c_ulong
=
0x5414
;
// TODO: some of the structs passed as T have padding bytes, so casting to a byte slice is UB
fn
dup_read
<
T
>
(
fd
:
c_int
,
name
:
&
str
,
t
:
&
mut
T
)
->
syscall
::
Result
<
usize
>
{
fn
dup_read
<
T
>
(
fd
:
c_int
,
name
:
&
str
,
t
:
&
mut
T
)
->
syscall
::
Result
<
usize
>
{
let
dup
=
syscall
::
dup
(
fd
as
usize
,
name
.as_bytes
())
?
;
let
dup
=
syscall
::
dup
(
fd
as
usize
,
name
.as_bytes
())
?
;
...
@@ -79,7 +83,8 @@ pub unsafe extern "C" fn ioctl(fd: c_int, request: c_ulong, out: *mut c_void) ->
...
@@ -79,7 +83,8 @@ pub unsafe extern "C" fn ioctl(fd: c_int, request: c_ulong, out: *mut c_void) ->
0
0
}
}
}
}
TCSETS
=>
{
// TODO: give these different behaviors
TCSETS
|
TCSETSW
|
TCSETSF
=>
{
let
termios
=
&*
(
out
as
*
const
termios
::
termios
);
let
termios
=
&*
(
out
as
*
const
termios
::
termios
);
if
e
(
dup_write
(
fd
,
"termios"
,
termios
))
==
!
0
{
if
e
(
dup_write
(
fd
,
"termios"
,
termios
))
==
!
0
{
-
1
-
1
...
...
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