Commit 08ec6caf authored by Jonas Termansen's avatar Jonas Termansen

Convert bench to C.

parent 114aa298
......@@ -5,9 +5,9 @@ include ../build-aux/version.mak
include ../build-aux/dirs.mak
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
CXXFLAGS?=$(OPTLEVEL)
CFLAGS?=$(OPTLEVEL)
CXXFLAGS:=$(CXXFLAGS) -Wall -Wextra -fno-exceptions -fno-rtti
CFLAGS:=$(CFLAGS) -Wall -Wextra
BINARIES:=\
benchsyscall \
......@@ -21,8 +21,8 @@ install: all
mkdir -p $(DESTDIR)$(BINDIR)
install $(BINARIES) $(DESTDIR)$(BINDIR)
%: %.cpp
$(CXX) -std=gnu++11 $(CPPFLAGS) $(CXXFLAGS) $< -o $@
%: %.c
$(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $< -o $@
clean:
rm -f $(BINARIES) *.o
......@@ -15,12 +15,13 @@
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
benchctxswitch.cpp
benchctxswitch.c
Benchmarks the speed of context switches.
*******************************************************************************/
#include <err.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
......@@ -37,7 +38,7 @@ static int uptime(uintmax_t* usecs)
return 0;
}
int main(int /*argc*/, char* /*argv*/[])
int main(void)
{
pid_t slavepid = fork();
if ( slavepid < 0 )
......
......@@ -15,8 +15,7 @@
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
benchsyscall.cpp
benchsyscall.c
Benchmarks the speed of system calls.
*******************************************************************************/
......@@ -35,7 +34,7 @@ static int uptime(uintmax_t* usecs)
return 0;
}
int main(int /*argc*/, char* /*argv*/[])
int main(void)
{
uintmax_t start;
if ( uptime(&start) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment