commit ec5863f121fac495b3158098ae4e498d5499ae37 parent 6bcfb4af2aa419e35a4971790bedfcd3f387cc70 Author: Vincent Forest <vincent.forest@meso-star.com> Date: Fri, 27 Oct 2023 17:08:06 +0200 Merge branch 'release_0.1' Diffstat:
| M | .gitignore | | | 15 | ++++++++------- |
| A | Makefile | | | 146 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | README.md | | | 51 | +++++++++++++++++++++++++++++---------------------- |
| D | cmake/CMakeLists.txt | | | 118 | ------------------------------------------------------------------------------- |
| A | config.mk | | | 77 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| D | doc/sbuf.5.scd | | | 66 | ------------------------------------------------------------------ |
| A | make.sh | | | 70 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | sbuf.5 | | | 82 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | sbuf.pc.in | | | 10 | ++++++++++ |
9 files changed, 422 insertions(+), 213 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -1,11 +1,12 @@ -CMakeCache.txt -CMakeFiles -Makefile -tmp +.gitignore [Bb]uild* *.sw[po] -*.[ao] -*.orig +*.[aod] +*.so *~ +test* +!test*.[ch] +.config +.test tags - +*.pc diff --git a/Makefile b/Makefile @@ -0,0 +1,146 @@ +# Copyright (C) 2022-2023 |Méso|Star> (contact@meso-star.com) +# +# 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 3 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, see <http://www.gnu.org/licenses/>. + +.POSIX: +.SUFFIXES: # Clean up default inference rules + +include config.mk + +LIBNAME_STATIC = libsbuf.a +LIBNAME_SHARED = libsbuf.so +LIBNAME = $(LIBNAME_$(LIB_TYPE)) + +################################################################################ +# Library building +################################################################################ +SRC = src/sbuf.c src/sbuf_log.c +OBJ = $(SRC:.c=.o) +DEP = $(SRC:.c=.d) + +build_library: .config $(DEP) + @$(MAKE) -fMakefile $$(for i in $(DEP); do echo -f $${i}; done) \ + $$(if [ -n "$(LIBNAME)" ]; then \ + echo "$(LIBNAME)"; \ + else \ + echo "$(LIBNAME_SHARED)"; \ + fi) + +$(DEP) $(OBJ): config.mk + +$(LIBNAME_SHARED): $(OBJ) + $(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -o $@ $(OBJ) $(LDFLAGS_SO) $(RSYS_LIBS) + +$(LIBNAME_STATIC): libsbuf.o + $(AR) -rc $@ $? + $(RANLIB) $@ + +libsbuf.o: $(OBJ) + $(LD) -r $(OBJ) -o $@ + $(OBJCOPY) $(OCPFLAGS) $@ + +.config: config.mk + @if ! $(PKG_CONFIG) --atleast-version $(RSYS_VERSION) rsys; then \ + echo "rsys $(RSYS_VERSION) not found" >&2; exit 1; fi + @echo "config done" > $@ + +.SUFFIXES: .c .d .o +.c.d: + @$(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -MM -MT "$(@:.d=.o) $@" $< -MF $@ + +.c.o: + $(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -DSBUF_SHARED_BUILD -c $< -o $@ + +################################################################################ +# Installation +################################################################################ +pkg: + sed -e 's#@PREFIX@#$(PREFIX)#g'\ + -e 's#@VERSION@#$(VERSION)#g'\ + -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g'\ + sbuf.pc.in > sbuf.pc + +sbuf-local.pc: sbuf.pc.in + sed -e '1d'\ + -e 's#^includedir=.*#includedir=./src/#'\ + -e 's#^libdir=.*#libdir=./#'\ + -e 's#@VERSION@#$(VERSION)#g'\ + -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g'\ + sbuf.pc.in > $@ + +install: build_library pkg + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib" $(LIBNAME) + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib/pkgconfig" sbuf.pc + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/include/star" src/sbuf.h + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/doc/star-buffer" COPYING README.md + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/man/man5" sbuf.5 + +uninstall: + rm -f "$(DESTDIR)$(PREFIX)/lib/$(LIBNAME)" + rm -f "$(DESTDIR)$(PREFIX)/lib/pkgconfig/sbuf.pc" + rm -f "$(DESTDIR)$(PREFIX)/share/doc/star-buffer/COPYING" + rm -f "$(DESTDIR)$(PREFIX)/share/doc/star-buffer/README.md" + rm -f "$(DESTDIR)$(PREFIX)/include/star/sbuf.h" + rm -f "$(DESTDIR)$(PREFIX)/share/man/man5/sbuf.5" + +################################################################################ +# Miscellaneous targets +################################################################################ +all: build_library build_tests + +clean: clean_test + rm -f $(OBJ) $(TEST_OBJ) $(LIBNAME) + rm -f .config .test libsbuf.o sbuf.pc sbuf-local.pc + +distclean: clean + rm -f $(DEP) $(TEST_DEP) + +lint: + shellcheck -o all make.sh + mandoc -Tlint -Wall sbuf.5 + +################################################################################ +# Tests +################################################################################ +TEST_SRC =\ + src/test_sbuf.c\ + src/test_sbuf_load.c +TEST_OBJ = $(TEST_SRC:.c=.o) +TEST_DEP = $(TEST_SRC:.c=.d) + +PKG_CONFIG_LOCAL = PKG_CONFIG_PATH="./:$${PKG_CONFIG_PATH}" $(PKG_CONFIG) +SBUF_CFLAGS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --cflags sbuf-local.pc) +SBUF_LIBS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --libs sbuf-local.pc) + +build_tests: build_library $(TEST_DEP) .test + @$(MAKE) -fMakefile -f.test $$(for i in $(TEST_DEP); do echo -f"$${i}"; done) test_bin + +test: build_tests + @$(SHELL) make.sh run_test $(TEST_SRC) + +.test: Makefile + @$(SHELL) make.sh config_test $(TEST_SRC) > $@ + +clean_test: + $(SHELL) make.sh clean_test $(TEST_SRC) + +$(TEST_DEP): config.mk sbuf-local.pc + @$(CC) $(CFLAGS_EXE) $(SBUF_CFLAGS) $(RSYS_CFLAGS) \ + -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ + +$(TEST_OBJ): config.mk sbuf-local.pc + $(CC) $(CFLAGS_EXE) $(SBUF_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@ + +test_sbuf test_sbuf_load: config.mk sbuf-local.pc $(LIBNAME) + $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(SBUF_LIBS) $(RSYS_LIBS) diff --git a/README.md b/README.md @@ -1,31 +1,38 @@ -# Star-Buffer +# Star Buffer -Star-Buffer is a C library that loads a buffer stored wrt the Star-Buffer file -format. +This C library loads data stored in the sbuf file format (see `sbuf.5` +for format specification). -## How to build +## Requirements -Star-Buffer is compatible 64-bit POSIX systems. It relies on the -[CMake](http://www.cmake.org) and the -[RCMake](https://gitlab.com/vaplv/rcmake/) packages to build. It also depends -on the [RSys](https://gitlab.com/vaplv/rsys/) library. It optionally depends on -[scdoc](https://sr.ht/~sircmpwn/scdoc/) which, if available, is used to -generate the man page of the Star-Mesh file format. +- C compiler +- POSIX make +- pkg-config +- [RSys](https://gitlab.com/vaplv/rsys) +- [mandoc](https://mandoc.bsd.lv) -First ensure that CMake is installed on your system. Then install the RCMake -package as well as the aforementioned prerequisites. Finally generate the -project from the `cmake/CMakeLists.txt` file by appending to the -`CMAKE_PREFIX_PATH` variable the install directories of its dependencies. The -resulting project can be edited, built, tested and installed as any CMake -project. Refer to the [CMake](https://cmake.org/documentation) for further -informations on CMake. +## Installation -## Copyright notice +Edit config.mk as needed, then run: -Copyright (C) 2022, 2023 [|Méso|Star>](https://www.meso-star.com) (<contact@meso-star.com>) + make clean install + +## Release notes + +### Version 0.1 + +- Write the man page directly in mdoc's roff macros, instead of using + the intermediate scdoc source. +- Replace CMake by Makefile as build system. +- Update compiler and linker flags to increase the security and + robustness of generated binaries. +- Provide a pkg-config file to link the library as an external + dependency. ## License -Star-Buffer is free software released under the GPL v3+ license: GNU GPL version -3 or later. You are welcome to redistribute it under certain conditions; refer -to the COPYING file for details. +Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) + +Star-Buffer is free software released under the GPL v3+ license: GNU GPL +version 3 or later. You are welcome to redistribute it under certain +conditions; refer to the COPYING file for details. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,118 +0,0 @@ -# Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) -# -# 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 3 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, see <http://www.gnu.org/licenses/>. - -cmake_minimum_required(VERSION 3.1) -project(sbuf C) -enable_testing() - -set(SBUF_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) -option(NO_TEST "Do not build tests" OFF) - -################################################################################ -# Check dependencies -################################################################################ -find_package(RCMake 0.4 REQUIRED) -find_package(RSys 0.10 REQUIRED) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR}) -include(rcmake) -include(rcmake_runtime) - -include_directories(${RSys_INCLUDE_DIR}) - -################################################################################ -# Configure and define targets -################################################################################ -set(VERSION_MAJOR 0) -set(VERSION_MINOR 0) -set(VERSION_PATCH 0) -set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) - -set(SBUF_FILES_SRC - sbuf.c - sbuf_log.c) -set(SBUF_FILES_INC - sbuf_c.h - sbuf_log.h) -set(SBUF_FILES_INC_API - sbuf.h) - -set(SBUF_FILES_DOC COPYING README.md) - -# Prepend each file in the `SBUF_FILES_<SRC|INC>' list by `SBUF_SOURCE_DIR' -rcmake_prepend_path(SBUF_FILES_SRC ${SBUF_SOURCE_DIR}) -rcmake_prepend_path(SBUF_FILES_INC ${SBUF_SOURCE_DIR}) -rcmake_prepend_path(SBUF_FILES_INC_API ${SBUF_SOURCE_DIR}) -rcmake_prepend_path(SBUF_FILES_DOC ${PROJECT_SOURCE_DIR}/../) - -add_library(sbuf SHARED ${SBUF_FILES_SRC} ${SBUF_FILES_INC} ${SBUF_FILES_INC_API}) -target_link_libraries(sbuf RSys) - -set_target_properties(sbuf PROPERTIES - DEFINE_SYMBOL SBUF_SHARED_BUILD - VERSION ${VERSION} - SOVERSION ${VERSION_MAJOR}) - -rcmake_setup_devel(sbuf StarBuffer ${VERSION} star/sbuf_version.h) - -################################################################################ -# Add tests -################################################################################ -if(NOT NO_TEST) - function(build_test _name) - add_executable(${_name} ${SBUF_SOURCE_DIR}/${_name}.c) - target_link_libraries(${_name} sbuf RSys ${ARGN}) - endfunction() - - function(new_test _name) - build_test(${_name} ${ARGN}) - add_test(${_name} ${_name}) - endfunction() - - new_test(test_sbuf) - new_test(test_sbuf_load) -endif() - -################################################################################ -# Man page -############################################################################### -find_program(SCDOC NAMES scdoc) -if(NOT SCDOC) - message(WARNING - "The `scdoc' program is missing. " - "The Star-Buffer man page cannot be generated.") -else() - set(_src ${PROJECT_SOURCE_DIR}/../doc/sbuf.5.scd) - add_custom_command( - OUTPUT sbuf.5 - COMMAND ${SCDOC} < ${_src} > sbuf.5 - DEPENDS ${_src} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Buid ROFF man page sbuf.5" - VERBATIM) - add_custom_target(man-roff ALL DEPENDS sbuf.5) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sbuf.5 DESTINATION share/man/man5) -endif() - -################################################################################ -# Define output & install directories -################################################################################ -install(TARGETS sbuf - ARCHIVE DESTINATION bin - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) -install(FILES ${SBUF_FILES_INC_API} DESTINATION include/star) -install(FILES ${SBUF_FILES_DOC} DESTINATION share/doc/star-buffer) - diff --git a/config.mk b/config.mk @@ -0,0 +1,77 @@ +VERSION = 0.1.0 +PREFIX = /usr/local + +LIB_TYPE = SHARED +#LIB_TYPE = STATIC + +BUILD_TYPE = RELEASE +#BUILD_TYPE = DEBUG + +################################################################################ +# Tools +################################################################################ +AR = ar +CC = cc +LD = ld +OBJCOPY = objcopy +PKG_CONFIG = pkg-config +RANLIB = ranlib + +################################################################################ +# Dependencies +################################################################################ +PCFLAGS_SHARED = +PCFLAGS_STATIC = --static +PCFLAGS = $(PCFLAGS_$(LIB_TYPE)) + +RSYS_VERSION = 0.14 +RSYS_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags rsys) +RSYS_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs rsys) + +################################################################################ +# Compilation options +################################################################################ +WFLAGS =\ + -Wall\ + -Wcast-align\ + -Wconversion\ + -Wextra\ + -Wmissing-declarations\ + -Wmissing-prototypes\ + -Wshadow + +CFLAGS_HARDENED =\ + -D_FORTIFY_SOURCES=2\ + -fcf-protection=full\ + -fstack-clash-protection\ + -fstack-protector-strong + +CFLAGS_COMMON =\ + -std=c89\ + -pedantic\ + -fvisibility=hidden\ + -fstrict-aliasing\ + $(CFLAGS_HARDENED)\ + $(WFLAGS) + +CFLAGS_DEBUG = -g $(CFLAGS_COMMON) +CFLAGS_RELEASE = -O2 -DNDEBUG $(CFLAGS_COMMON) +CFLAGS = $(CFLAGS_$(BUILD_TYPE)) + +CFLAGS_SO = $(CFLAGS) -fPIC +CFLAGS_EXE = $(CFLAGS) -fPIE + +################################################################################ +# Linker options +################################################################################ +LDFLAGS_HARDENED = -Wl,-z,relro,-z,now +LDFLAGS_DEBUG = $(LDFLAGS_HARDENED) +LDFLAGS_RELEASE = -s $(LDFLAGS_HARDENED) +LDFLAGS = $(LDFLAGS_$(BUILD_TYPE)) + +LDFLAGS_SO = $(LDFLAGS) -shared -Wl,--no-undefined +LDFLAGS_EXE = $(LDFLAGS) -pie + +OCPFLAGS_DEBUG = --localize-hidden +OCPFLAGS_RELEASE = --localize-hidden --strip-unneeded +OCPFLAGS = $(OCPFLAGS_$(BUILD_TYPE)) diff --git a/doc/sbuf.5.scd b/doc/sbuf.5.scd @@ -1,66 +0,0 @@ -sbuf(5) - -; Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) -; -; 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 3 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, see <http://www.gnu.org/licenses/>. - -# NAME - -sbuf - Star-Buffer file format - -# DESCRIPTION - -*sbuf* is a binary file format for storing data in a 1-dimensional array. - -A *sbuf* file begins with a header of four 64-bits integers. The first integer -is a power of two (usually 4096) that defines the size of the memory page in -bytes (_pagesize_) on wich the array is aligned. By aligning the array on -_pagesize_, and depending on system requirements, memory mapping can be used to -automatically load/unload the array items on demand (see *mmap*(2)). The second -integer is the _size_ of the array. Finally, the 2 remaining integers store the -memory size and the memory alignment of each array element. - -Fill bytes follow the file header to align the array to _pagesize_. The array -elements are then listed. Fill bytes are finally added to ensure that the -overall file size is a multiple of _pagesize_. - -# BINARY FILE - -Data are encoded with respect to the little endian bytes ordering, i.e. least -significant bytes are stored first. - -``` -<sbuf> ::= <pagesize> <size> <szitem> <alitem> - <padding> - <list> - <padding> - -<pagesize> ::= UINT64 -<size> ::= UINT64 # Number of items stored -<szitem> ::= UINT64 # Size of an item in bytes -<alitem> ::= UINT64 # Alignment of an item (must be <= pagesize) - ---- - -<list> ::= <element> <padding> [ <element> <padding> ]... -<element> ::= BYTE [ BYTE ... ] - ---- - -<padding> ::= [ BYTE ... ] # Ensure alignement -``` - -# SEE ALSO - -*mmap*(2) diff --git a/make.sh b/make.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +# Copyright (C) 2022-2023 |Méso|Star> (contact@meso-star.com) +# +# 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 3 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, see <http://www.gnu.org/licenses/>. + +set -e + +config_test() +{ + for i in "$@"; do + test=$(basename "${i}" ".c") + test_list="${test_list} ${test}" + printf "%s: %s\n" "${test}" "src/${test}.o" + done + printf "test_bin: %s\n" "${test_list}" +} + +run_test() +{ + for i in "$@"; do + test=$(basename "${i}" ".c") + + printf "%s " "${test}" + if "./${test}" > /dev/null 2>&1; then + printf "\033[1;32mOK\033[m\n" + else + printf "\033[1;31mError\033[m\n" + fi + done 2> /dev/null +} + +clean_test() +{ + for i in "$@"; do + rm -f "$(basename "${i}" ".c")" + done +} + +install() +{ + prefix=$1 + shift 1 + + mkdir -p "${prefix}" + + for i in "$@"; do + dst="${prefix}/${i##*/}" + + if cmp -s "${i}" "${dst}"; then + printf "Up to date %s\n" "${dst}" + else + printf "Installing %s\n" "${dst}" + cp "${i}" "${prefix}" + fi + done +} + +"$@" diff --git a/sbuf.5 b/sbuf.5 @@ -0,0 +1,82 @@ +.\" Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) +.\" +.\" 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 3 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, see <http://www.gnu.org/licenses/>. +.Dd October 27, 2023 +.Dt SBUF 5 +.Os +.Sh NAME +.Nm sbuf +.Nd Star-Buffer file format +.Sh DESCRIPTION +.Nm +is a binary file format for storing data in a 1-dimensional array. +.Pp +A +.Nm +file begins with a header of four 64-bits integers. +The first integer is a power of two +.Pq usually 4096 +that defines the size of the memory page in bytes +.Pq Va pagesize +on wich the array is aligned. +By aligning the array on +.Va pagesize , +and depending on system requirements, memory mapping can be used to +automatically load/unload the array items on demand +.Pq see Xr mmap 2 . +The second integer is the +.Va size +of the array. +Finally, the 2 remaining integers store the memory size and the memory +alignment of each array element. +.Pp +Fill bytes follow the file header to align the array to +.Va pagesize . +The array elements are then listed. +Fill bytes are finally added to ensure that the overall file size is a multiple +of +.Va pagesize . +.Pp +Data are encoded with respect to the little endian bytes ordering, i.e. least +significant bytes are stored first. +.Pp +The file format is as follows: +.Bl -column (pagesize) (::=) () +.It Ao Va sbuf Ac Ta ::= Ta +.Aq Va pagesize +.Aq Va size +.Aq Va szitem +.Aq Va alitem +.It Ta Ta Aq Va padding +.It Ta Ta Aq Va list +.It Ta Ta Aq Va padding +.It \ Ta Ta +.It Ao Va pagesize Ac Ta ::= Ta Vt uint64_t +.It Ao Va size Ac Ta ::= Ta Vt uint64_t +# Number of items stored +.It Ao Va szitem Ac Ta ::= Ta Vt uint64_t +# Size of an item in bytes +.It Ao Va alitem Ac Ta ::= Ta Vt uint64_t +# Alignement of an item (<= pagesize) +.It \ Ta Ta +.It Ao Va list Ac Ta ::= Ta Ao Va element Ac Va ... +.It Ao Va element Ac Ta ::= Ta Ao Va item Ac Ao Va padding Ac +.It Ao Va item Ac Ta ::= Ta Vt char ... +.It \ Ta Ta +.It Ao Va padding Ac Ta ::= Ta Op Vt int8_t ... +# Ensure alignment on +.Va pagesize +.El +.Sh SEE ALSO +.Xr mmap 2 diff --git a/sbuf.pc.in b/sbuf.pc.in @@ -0,0 +1,10 @@ +prefix=@PREFIX@ +includedir=${prefix}/include +libdir=${prefix}/lib + +Requires: rsys >= @RSYS_VERSION@ +Name: Star-Buffer +Description: Star Buffer library +Version: @VERSION@ +Libs: -L${libdir} -lsbuf +CFlags: -I${includedir}