* [PATCH BlueZ v2] btattach: Update for glibc 2.42 compatibility
@ 2026-09-03 22:20 Aaron Brice
2026-09-03 23:47 ` [BlueZ,v2] " bluez.test.bot
2026-09-04 20:20 ` [PATCH BlueZ v2] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Aaron Brice @ 2026-09-03 22:20 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Aaron Brice
btattach is not setting the baud rate correctly on systems with newer
glibc such as Ubuntu 26.04. In glibc 2.42 the baud rate termios.h
constants changed value, B115200 was 0x1002 which was the struct
termios c_cflag enum bits, but in 2.42 they changed cfsetspeed() to
accept arbitrary rates and not just the baud enum values, and B115200
was changed to the value 115200. This means you can no longer set the
speed with c_cflag |= B115200 and should use cfsetspeed() to be
compatible with both versions.
---
tools/btattach.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/btattach.c b/tools/btattach.c
index 5f7d19093..cdd7b125b 100644
--- a/tools/btattach.c
+++ b/tools/btattach.c
@@ -64,7 +64,12 @@ static int open_serial(const char *path, unsigned int speed, bool flowctl)
memset(&ti, 0, sizeof(ti));
cfmakeraw(&ti);
- ti.c_cflag |= (speed | CLOCAL | CREAD);
+ ti.c_cflag |= (CLOCAL | CREAD);
+ if (cfsetspeed(&ti, speed) < 0) {
+ perror("Failed to set serial port speed");
+ close(fd);
+ return -1;
+ }
if (flowctl) {
/* Set flow control */
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [BlueZ,v2] btattach: Update for glibc 2.42 compatibility
2026-09-03 22:20 [PATCH BlueZ v2] btattach: Update for glibc 2.42 compatibility Aaron Brice
@ 2026-09-03 23:47 ` bluez.test.bot
2026-09-04 20:20 ` [PATCH BlueZ v2] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-09-03 23:47 UTC (permalink / raw)
To: linux-bluetooth, aaron
[-- Attachment #1: Type: text/plain, Size: 824 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1157441
---Test result---
Test Summary:
CheckPatch PASS 0.45 seconds
GitLint PASS 0.31 seconds
BuildEll PASS 15.85 seconds
BluezMake PASS 494.98 seconds
CheckSmatch PASS 231.22 seconds
bluezmakeextell PASS 74.44 seconds
IncrementalBuild PASS 453.86 seconds
ScanBuild PASS 718.81 seconds
https://github.com/bluez/bluez/pull/2490
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ v2] btattach: Update for glibc 2.42 compatibility
2026-09-03 22:20 [PATCH BlueZ v2] btattach: Update for glibc 2.42 compatibility Aaron Brice
2026-09-03 23:47 ` [BlueZ,v2] " bluez.test.bot
@ 2026-09-04 20:20 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-09-04 20:20 UTC (permalink / raw)
To: Aaron Brice; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Thu, 3 Sep 2026 15:20:05 -0700 you wrote:
> btattach is not setting the baud rate correctly on systems with newer
> glibc such as Ubuntu 26.04. In glibc 2.42 the baud rate termios.h
> constants changed value, B115200 was 0x1002 which was the struct
> termios c_cflag enum bits, but in 2.42 they changed cfsetspeed() to
> accept arbitrary rates and not just the baud enum values, and B115200
> was changed to the value 115200. This means you can no longer set the
> speed with c_cflag |= B115200 and should use cfsetspeed() to be
> compatible with both versions.
>
> [...]
Here is the summary with links:
- [BlueZ,v2] btattach: Update for glibc 2.42 compatibility
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=12f5eb726c6e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-04 20:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 22:20 [PATCH BlueZ v2] btattach: Update for glibc 2.42 compatibility Aaron Brice
2026-09-03 23:47 ` [BlueZ,v2] " bluez.test.bot
2026-09-04 20:20 ` [PATCH BlueZ v2] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox