Skip to content

Instantly share code, notes, and snippets.

View adzierzanowski's full-sized avatar
🙃
the cake is a lie

adzierzanowski

🙃
the cake is a lie
View GitHub Profile
@adzierzanowski
adzierzanowski / main.c
Created September 2, 2020 22:23
Emulate serial port with pseudoterminal device
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
int main()
{
int fd = posix_openpt(O_RDWR | O_NOCTTY);
grantpt(fd);
unlockpt(fd);