Skip to contentSkip to conversation

syscalls: Remove getcontext01

RFC PATCH New Petr Vorel 3 participants 7 messages Jul 22, 2019

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

RFC PATCH 1/1 syscalls: Remove getcontext01

According to man getcontext(3) getcontext was this function from POSIX.1-2001 (SUSv2) removed from POSIX.1-2008 (SUSv3).

Given that the test was just a smoke tests (doing nothing) and we don't test other functions from this family ({set,swap,make}context) remove it.

---
 runtest/syscalls                              |  2 -
 .../kernel/syscalls/getcontext/.gitignore     |  1 -
 testcases/kernel/syscalls/getcontext/Makefile | 23 -----
 .../kernel/syscalls/getcontext/getcontext01.c | 89 -------------------
 4 files changed, 115 deletions(-)
 delete mode 100644 testcases/kernel/syscalls/getcontext/.gitignore
 delete mode 100644 testcases/kernel/syscalls/getcontext/Makefile
 delete mode 100644 testcases/kernel/syscalls/getcontext/getcontext01.c
runtest/syscalls +0 -2
index 67dfed661..432cd3ac5 100644
@@ -363,8 +363,6 @@ ftruncate04_64 ftruncate04_64
 #futimesat test cases
 futimesat01 futimesat01
 
-getcontext01 getcontext01
-
 getcpu01 getcpu01
 
 getcwd01 getcwd01
testcases/kernel/syscalls/getcontext/.gitignore deleted +0 -1
deleted file mode 100644
index 1e5e14e73..000000000
@@ -1 +0,0 @@
-/getcontext01
testcases/kernel/syscalls/getcontext/Makefile deleted +0 -23
deleted file mode 100644
index bd617d806..000000000
@@ -1,23 +0,0 @@
-#
-#  Copyright (c) International Business Machines  Corp., 2001
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/getcontext/getcontext01.c deleted +0 -89

89 lines not on this page · raw message

Signature · 1 line
2.22.0
#1 lore raw

RFC PATCH 1/1 syscalls: Remove getcontext01

Hi Petr,

gercontext is filtered for uclinux and android in syscalls/Makefile so we can remove it as well. :-)

Best Regards,
Xiao Yang
On 2019/07/22 16:33, Petr Vorel write:

Quoted 161 lines

According to man getcontext(3) getcontext was this function from POSIX.1-2001 (SUSv2) removed from POSIX.1-2008 (SUSv3).

Given that the test was just a smoke tests (doing nothing) and we don't test other functions from this family ({set,swap,make}context) remove it.

---
  runtest/syscalls                              |  2 -
  .../kernel/syscalls/getcontext/.gitignore     |  1 -
  testcases/kernel/syscalls/getcontext/Makefile | 23 -----
  .../kernel/syscalls/getcontext/getcontext01.c | 89 -------------------
  4 files changed, 115 deletions(-)

delete mode 100644 testcases/kernel/syscalls/getcontext/.gitignore delete mode 100644 testcases/kernel/syscalls/getcontext/Makefile delete mode 100644 testcases/kernel/syscalls/getcontext/getcontext01.c

runtest/syscalls +0 -2
index 67dfed661..432cd3ac5 100644
@@ -363,8 +363,6 @@ ftruncate04_64 ftruncate04_64
  #futimesat test cases
  futimesat01 futimesat01
 
-getcontext01 getcontext01
-
  getcpu01 getcpu01
 
  getcwd01 getcwd01
testcases/kernel/syscalls/getcontext/.gitignore deleted +0 -1
deleted file mode 100644
index 1e5e14e73..000000000
@@ -1 +0,0 @@
-/getcontext01
testcases/kernel/syscalls/getcontext/Makefile deleted +0 -23
deleted file mode 100644
index bd617d806..000000000
@@ -1,23 +0,0 @@
-#
-#  Copyright (c) International Business Machines  Corp., 2001
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/getcontext/getcontext01.c deleted +0 -89
deleted file mode 100644
index 48e78907f..000000000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2005.  All Rights Reserved.
- *  Author: Prashant P Yendigeri<[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include<features.h>
-
-#include<stdio.h>
-#include<unistd.h>
-#include<errno.h>
-#include<ucontext.h>
-
-#include "test.h"
-
-char *TCID = "getcontext01";
-
-#if !defined(__UCLIBC__)
-
-static void setup(void);
-static void cleanup(void);
-
-int TST_TOTAL = 1;
-
-static void test_getcontext(void)
-{
-	ucontext_t ptr;
-
-	TEST(getcontext(&ptr));
-
-	if (TEST_RETURN == -1) {
-		if (errno == ENOSYS)
-			tst_resm(TCONF, "getcontext not implemented in libc");
-		else
-			tst_resm(TFAIL | TTERRNO, "getcontext failed");
-	} else if (TEST_RETURN == 0) {
-		tst_resm(TPASS, "getcontext passed");
-	} else {
-		tst_resm(TFAIL, "Unexpected return value %li", TEST_RETURN);
-	}
-}
-
-int main(int ac, char **av)
-{
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		test_getcontext();
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-static void setup(void)
-{
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-}
-
-static void cleanup(void)
-{
-}
-
-#else /* systems that dont support obsolete getcontext */
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "system doesn't have getcontext support");
-}
-#endif
author
#2 lore raw

RFC PATCH 1/1 syscalls: Remove getcontext01

Hi Xiao,

Quoted 4 lines

Hi Petr,

gercontext is filtered for uclinux and android in syscalls/Makefile so we can remove it as well. :-)

Filtering by architecture is IMHO wrong, at least for cases like this one when it can be detected. And uclinux has some filtering in Makefile other in sources.

Kind regards,
Petr

#3 lore raw

RFC PATCH 1/1 syscalls: Remove getcontext01

In reply to Petr Vorel

Hi!

Quoted 2 lines

According to man getcontext(3) getcontext was this function from POSIX.1-2001 (SUSv2) removed from POSIX.1-2008 (SUSv3).

Being deprecated from POSIX is never a reason to remove tests as far as the API is exposed to userspace it should be tested.

Quoted 2 lines

Given that the test was just a smoke tests (doing nothing) and we don't test other functions from this family ({set,swap,make}context) remove it.

I wouldn't say it's doing nothing, it asserts that call to getcontext() returns 0, which is very basic but still a valid test.

What is the real motivation for this removal?

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#4 lore raw

RFC PATCH 1/1 syscalls: Remove getcontext01

Hi Cyril,

Quoted 5 lines
Quoted 2 lines

According to man getcontext(3) getcontext was this function from POSIX.1-2001 (SUSv2) removed from POSIX.1-2008 (SUSv3).

Being deprecated from POSIX is never a reason to remove tests as far as the API is exposed to userspace it should be tested.

OK, thanks for a clarification. I thought that, but wasn't sure. That's why this RFC. Agree with the point + it's still in current glibc.

BTW Maybe it'd be good to write down this policy + write which glibc versions we support, which would answer whether some functionality can be removed in given point (we describe goals and mention glibc in old document doc/ltp-howto.{txt,lyx}, but IMHO we should update this document remove lyx version and add it to wiki).

Quoted 5 lines
Quoted 2 lines

Given that the test was just a smoke tests (doing nothing) and we don't test other functions from this family ({set,swap,make}context) remove it.

I wouldn't say it's doing nothing, it asserts that call to getcontext() returns 0, which is very basic but still a valid test.

Right :).

Quoted 1 line

What is the real motivation for this removal?

Looking over the weekend on tests which does not compile on musl (which does not include deprecated functionality). I'll rewrite the test into new API and add autotools check.

Kind regards,
Petr

#5 lore raw

RFC PATCH 1/1 syscalls: Remove getcontext01

Hi!

Quoted 9 lines
Quoted 2 lines

Being deprecated from POSIX is never a reason to remove tests as far as the API is exposed to userspace it should be tested.

OK, thanks for a clarification. I thought that, but wasn't sure. That's why this RFC. Agree with the point + it's still in current glibc.

BTW Maybe it'd be good to write down this policy + write which glibc versions we support, which would answer whether some functionality can be removed in given point (we describe goals and mention glibc in old document doc/ltp-howto.{txt,lyx}, but IMHO we should update this document remove lyx version and add it to wiki).

I guess that the ltp-howto.lyx should be just removed along with the man3 directory, generally the doc/ directory could use some cleanup.

Also we do have most of the up-to-date documentation in the test-writing-guidelines.txt so I we may as well add this kind of information there.

Quoted 4 lines
Quoted 1 line

What is the real motivation for this removal?

Looking over the weekend on tests which does not compile on musl (which does not include deprecated functionality). I'll rewrite the test into new API and add autotools check.

Ack.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#6 lore raw

RFC PATCH 1/1 syscalls: Remove getcontext01

Hi Cyril,

Quoted 10 lines
Quoted 9 lines
Quoted 2 lines

Being deprecated from POSIX is never a reason to remove tests as far as the API is exposed to userspace it should be tested.

OK, thanks for a clarification. I thought that, but wasn't sure. That's why this RFC. Agree with the point + it's still in current glibc.

BTW Maybe it'd be good to write down this policy + write which glibc versions we support, which would answer whether some functionality can be removed in given point (we describe goals and mention glibc in old document doc/ltp-howto.{txt,lyx}, but IMHO we should update this document remove lyx version and add it to wiki).

Quoted 6 lines

I guess that the ltp-howto.lyx should be just removed along with the man3 directory, generally the doc/ directory could use some cleanup.

Also we do have most of the up-to-date documentation in the test-writing-guidelines.txt so I we may as well add this kind of information there.

Agree with both.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

What is the real motivation for this removal?

Looking over the weekend on tests which does not compile on musl (which does not include deprecated functionality). I'll rewrite the test into new API and add autotools check.

Ack.

thx.

Kind regards,
Petr