Print this page
cfsetspeed


  32 .\" or http://www.opensolaris.org/os/licensing.
  33 .\" See the License for the specific language governing permissions
  34 .\" and limitations under the License.
  35 .\"
  36 .\" When distributing Covered Code, include this CDDL HEADER in each
  37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38 .\" If applicable, add the following below this CDDL HEADER, with the
  39 .\" fields enclosed by brackets "[]" replaced with your own identifying
  40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41 .\"
  42 .\"
  43 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
  44 .\" Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
  45 .\" Copyright 2019, Joyent, Inc.
  46 .\"
  47 .Dd January 20, 2019
  48 .Dt CFSETISPEED 3C
  49 .Os
  50 .Sh NAME
  51 .Nm cfsetispeed ,
  52 .Nm cfsetospeed

  53 .Nd set input and output baud rate
  54 .Sh SYNOPSIS
  55 .In termios.h
  56 .Ft int
  57 .Fo cfsetispeed
  58 .Fa "struct termios *termios_p"
  59 .Fa "speed_t speed"
  60 .Fc
  61 .Ft int
  62 .Fo cfsetospeed
  63 .Fa "struct termios *termios_p"
  64 .Fa "speed_t speed"
  65 .Fc





  66 .Sh DESCRIPTION
  67 The
  68 .Fn cfsetispeed
  69 function sets the input baud rate stored in the
  70 structure pointed to by
  71 .Fa termios_p
  72 to
  73 .Fa speed .
  74 .Pp
  75 The
  76 .Fn cfsetospeed
  77 function sets the output baud rate stored in the
  78 structure pointed to by
  79 .Fa termios_p
  80 to
  81 .Fa speed .
  82 .Pp








  83 There is no effect on the baud rates set in the hardware until a subsequent
  84 successful call to
  85 .Xr tcsetattr 3C
  86 on the same
  87 .Vt termios
  88 structure.
  89 .Sh RETURN VALUES
  90 Upon successful completion,
  91 .Fn cfsetispeed
  92 and
  93 .Fn cfsetospeed
  94 return
  95 .Sy 0 .
  96 Otherwise
  97 .Sy \(mi1
  98 is returned, and
  99 .Va errno
 100 may be set to indicate the error.
 101 .Sh ERRORS
 102 The




  32 .\" or http://www.opensolaris.org/os/licensing.
  33 .\" See the License for the specific language governing permissions
  34 .\" and limitations under the License.
  35 .\"
  36 .\" When distributing Covered Code, include this CDDL HEADER in each
  37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38 .\" If applicable, add the following below this CDDL HEADER, with the
  39 .\" fields enclosed by brackets "[]" replaced with your own identifying
  40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41 .\"
  42 .\"
  43 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
  44 .\" Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
  45 .\" Copyright 2019, Joyent, Inc.
  46 .\"
  47 .Dd January 20, 2019
  48 .Dt CFSETISPEED 3C
  49 .Os
  50 .Sh NAME
  51 .Nm cfsetispeed ,
  52 .Nm cfsetospeed ,
  53 .Nm cfsetspeed
  54 .Nd set input and output baud rate
  55 .Sh SYNOPSIS
  56 .In termios.h
  57 .Ft int
  58 .Fo cfsetispeed
  59 .Fa "struct termios *termios_p"
  60 .Fa "speed_t speed"
  61 .Fc
  62 .Ft int
  63 .Fo cfsetospeed
  64 .Fa "struct termios *termios_p"
  65 .Fa "speed_t speed"
  66 .Fc
  67 .Ft int
  68 .Fo cfsetspeed
  69 .Fa "struct termios *termios_p"
  70 .Fa "speed_t speed"
  71 .Fc
  72 .Sh DESCRIPTION
  73 The
  74 .Fn cfsetispeed
  75 function sets the input baud rate stored in the
  76 structure pointed to by
  77 .Fa termios_p
  78 to
  79 .Fa speed .
  80 .Pp
  81 The
  82 .Fn cfsetospeed
  83 function sets the output baud rate stored in the
  84 structure pointed to by
  85 .Fa termios_p
  86 to
  87 .Fa speed .
  88 .Pp
  89 The
  90 .Fn cfsetspeed
  91 function sets both the input and output baud rate stored in the structure
  92 pointed to by
  93 .Fa termios_p
  94 to
  95 .Fa speed.
  96 .Pp
  97 There is no effect on the baud rates set in the hardware until a subsequent
  98 successful call to
  99 .Xr tcsetattr 3C
 100 on the same
 101 .Vt termios
 102 structure.
 103 .Sh RETURN VALUES
 104 Upon successful completion,
 105 .Fn cfsetispeed
 106 and
 107 .Fn cfsetospeed
 108 return
 109 .Sy 0 .
 110 Otherwise
 111 .Sy \(mi1
 112 is returned, and
 113 .Va errno
 114 may be set to indicate the error.
 115 .Sh ERRORS
 116 The