Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Dec 2018 17:10:19 -0500
From:      "James B. Byrne" <>
Subject:   clang FreeBSD question
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
I am hacking an old terminal emulator program originally written for
something other than FreeBSD. Ihave encountered this error:

cc -I../ -I../BSDI -I/usr/include -I/usr/local/include  
tty.c:179:28: error: use of undeclared identifier 'CBAUD'
  curr_termio.c_cflag &= ~(CBAUD);

The code in question looks like this:

  if (cfsetispeed((PTERMIO)&curr_termio, speed) == -1)
      printf ("Error %d from cfsetispeed(%s)\n", errno, deviceinfo);
      show_tty_error ("cfsetispeed()", errno);
  if (cfsetospeed((PTERMIO)&curr_termio, speed) == -1)
      printf ("Error %d from cfsetospeed(%s)\n", errno, deviceinfo);
      show_tty_error ("cfsetospeed()", errno);
  curr_termio.c_cflag &= ~(CBAUD);
  curr_termio.c_cflag |= speed;

I can guess that FreeBSD is not a POSIX compliant OS, or at least does
not declar itself so in the manner the programmer expected.  However,
the only other references to CBAUD that I can find on this system is:

/usr/local/include/gphoto2/gphoto2-port-portability.h:99:#   define
CBAUD   0x0000100f
/usr/local/include/gphoto2/gphoto2-port-portability.h:129:#   define
CBAUDEX 0x00001000

Soooo.  The question is: Do I just define CBAUD by copy and paste into
a header file and add that to the complier includes?  Or is their a
more informed and elegant answer to my problem?

***          e-Mail is NOT a SECURE channel          ***
        Do NOT transmit sensitive data via e-Mail
 Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne      
Harte & Lyne Limited
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3

Want to link to this message? Use this URL: <>