[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/NEWLIB PATCH 7/8] Import tcgetattr() and tcsetattr() functions from musl


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Mon, 5 Aug 2019 18:17:49 +0300
  • Cc: felipe.huici@xxxxxxxxx, simon.kuenzer@xxxxxxxxx, sharan.santhanam@xxxxxxxxx
  • Delivery-date: Mon, 05 Aug 2019 15:18:07 +0000
  • Ironport-phdr: 9a23:sR7VBhWFeTpDFKru6AY42K5ef0zV8LGtZVwlr6E/grcLSJyIuqrYbR2Ht8tkgFKBZ4jH8fUM07OQ7/m6HzVYvt3R6zgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrswndrNQajZdgJ6o+yRbErGZDdvhLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PWwt68LlqRfMTQ2U5nsBSWoWiQZHAxLE7B7hQJj8tDbxu/dn1ymbOc32Sq00WSin4qx2RhLklDsLOjgk+2zRl8d+jr9UoAi5qhJ/3YDafY+bOvl5cKzfc9MXXnZNUtpLWiBdGI6wc5cDAuwcNuhYtYn9oF4OoAOgCAmrH+Pv1j5Ihnnr1qM8zuQhCRzG1xEnEt0St3TUt8n1NKYUUeyvyKnI0C3Db+5N1Djh84jEaAghoeyXUr5qa8rRzlAiGgXYhVuerozlOima1uULs2WD6upgSPmvi2o+pwF1ozig3dsjhpPOhoIPxVDJ8zhyzoUtJdCgVUJ2bsOoHIFTuiyaLYd6XN0uTmNytCs00rEKpJG2cDUQxJkkxxPTceKLfoaG7x75SeqcLil0iXR4c7ylnRmy61KvyujkW8mx11ZFszRKn8HXtnAIyxzT8s+HSuZh/ku52TaAyQTT6uZcLEAqkKrUMZ8hwroqmpUPqkTPBDf2mFjtg6OMbEUk/fCk6+XhYrr4up+RL5J4hw7jPqg0mcGyAf40PhYQU2WZ4+ix2qXv/UjjT7VLiv02nLPZsJffJckDuqG5BBRV0poi6xa5FTum1MkYnWEaLF9eZB2HlJLlO0nTIP/jF/u/mVOsnC9xx//aJr3hHonNLn/bnbfkfLZ97U9cyA0ozdxG+p1bFK8BL+z3WkLqsNzYDwQ5MxCvw+r9B9RyyIUeVXiIAq+DP6PYqUWI6f43I+mQeI8Vvy7wK/Y76P7qjH85gUEScbOp3ZsKaXC3AvVmLl6fYXXyntgBFX0FsREkQOP0lV2ISSRTaGqqX6Ig+jE7D5qrDZzDRo+3mryOxiG7EodNZm9cDFCMDXfoeJ+CW/gWbSKfOclhnSIYWrilUYAuzguiuxHny7B/NOrb5jUYtY7/1Nhy/+DTjhAy9TlzD8SbyW2NTHx0kX0ORz43wq9/u1dwylGd3qdkh/xXD8dc6+lXXQcnZtbgyLl/CtbzXRmEctqXRVKORtS9HSp3Xt83hdgUbBVTAdKn2zvExDarBfcxiqSWTMg/9bnA3n63I9tl1l7Nz+85klNgWMwZZj7uvbJ26wWGX92BqE6ejav/Lak=
  • Ironport-sdr: gNI7JMcSEpqiSUJDz5SENRorhTjHQRD2ai4XCX5lWpcZoDbWZnqJ9EG27zUyLN3KXmJOoLOQdF u+ICjb7J+Umg==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Copied as is from official musl git mirror
git://git.musl-libc.org/musl, commit 6fcb440d.

Original file locations:
* src/termios/tcgetattr.c
* src/termios/tcsetattr.c

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 musl-imported/src/termios/tcgetattr.c |  9 +++++++++
 musl-imported/src/termios/tcsetattr.c | 12 ++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 musl-imported/src/termios/tcgetattr.c
 create mode 100644 musl-imported/src/termios/tcsetattr.c

diff --git a/musl-imported/src/termios/tcgetattr.c 
b/musl-imported/src/termios/tcgetattr.c
new file mode 100644
index 0000000..545a0bf
--- /dev/null
+++ b/musl-imported/src/termios/tcgetattr.c
@@ -0,0 +1,9 @@
+#include <termios.h>
+#include <sys/ioctl.h>
+
+int tcgetattr(int fd, struct termios *tio)
+{
+       if (ioctl(fd, TCGETS, tio))
+               return -1;
+       return 0;
+}
diff --git a/musl-imported/src/termios/tcsetattr.c 
b/musl-imported/src/termios/tcsetattr.c
new file mode 100644
index 0000000..94df18f
--- /dev/null
+++ b/musl-imported/src/termios/tcsetattr.c
@@ -0,0 +1,12 @@
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+
+int tcsetattr(int fd, int act, const struct termios *tio)
+{
+       if (act < 0 || act > 2) {
+               errno = EINVAL;
+               return -1;
+       }
+       return ioctl(fd, TCSETS+act, tio);
+}
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.