Commit Graph

23 Commits

Author SHA1 Message Date
Keith Packard 962e42cf1d tests, samples: Define _POSIX_C_SOURCE where needed
Various tests and samples use POSIX-only functions. Define _POSIX_C_SOURCE
to ensure they are visible.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-09-16 20:17:35 +02:00
Fin Maaß 6e975952f8 samples: posix: gettimeofday: add sntp resync option
add sntp resync option to sample.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-09-12 14:48:07 +02:00
Benjamin Cabé 1b66353a8d samples: posix: use zephyr:code-sample directive
Describe the samples using code-sample directive in preparation for
upcoming changes to the Zephyr documentation that will be leveraging
the provided description and metadata.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-08-27 15:13:43 -04:00
Robert Lubos 63d4037e2f samples: net: Exclude native_posix when socket service lib is used
Socket service library uses eventfd, which does not work with
native_posix platform, hence need to exclude it from samples that now
rely on socket services.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-05-29 11:59:51 +02:00
Cui Wei cdb8f3cc47 samples: posix: gettimeofday: Fix fatal error caused by small stack
Fix #68727.

Signed-off-by: Cui Wei <chris.wei.cui@foxmail.com>
2024-02-14 10:58:42 +01:00
Doug Foster 9fe370ef36 samples: doc: Added/Updated README and Makefile for POSIX samples
Added README.rst for eventfd and uname samples. Updated README for
gettimeofday to align with other READMEs.Updated Makefile.host
file for samples to store output file in 'build' directory.

Signed-off-by: Doug Foster <dougwfost@gmail.com>
2024-01-19 10:32:23 +01:00
Keith Packard 1e5c46df3d samples: Switch from NEWLIB_LIBC to REQUIRES_FULL_LIBC
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF and adjust
CONFIG_LIBC_MALLOC_ARENA_SIZE as needed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-25 08:32:06 +02:00
Alberto Escolar Piedras a12dff48ac samples net/posix: Rename old Makefiles and clarify READMEs
The old Makefiles which can be used to build this samples
directly as Linux apps and the description in the READMEs
could be quite missleading.

Building this apps in this way has nothing to do with the
Zephyr native_posix/sim targets. This is about building
them as actual Linux applications without Zephyr or any
HW models.

So let's rename the Makefiles and change the description
in the docs to avoid confusion.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:01:42 +02:00
Gerard Marull-Paretas 93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Christopher Friedt 85b44f0ed7 samples: posix: gettimeofday: include time.h
Due to some previous time-related header issues, we included
`<sys/time.h>` without including `<time.h>`. The latter is
necessary for `time()` (specified by both ISO C and POSIX).

Fixes #53673

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-01-11 09:41:29 +01:00
Yuval Peress 53ef68d459 include: Prefix includes to use a scope
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
  example: <irq.h> -> <zephyr/irq.h>

Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00
Gerard Marull-Paretas 260deccb6e doc: use :kconfig:option: domain role
Kconfig options now belong to the Kconfig domain, therefore, the
:kconfig:option: role needs to be used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-02 09:28:37 +01:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Gerard Marull-Paretas 9dfbdf1997 doc: use kconfig role and directive
Stop using :option: for Kconfig options.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-06-29 10:26:28 -04:00
Andy Ross 881c800736 samples/posix/gettimeofday: Filter out INTEL_ADSP
This platform has a newlib which is inexplicably missing a
_gettimeofday_r symbol.  Just filter the test there.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Peter Bigot 1d026703c4 samples: posix: gettimeofday: incorporate libc time API tests
Use time(), localtime_r(), and asctime() to confirm that the
declarations required for these (newlib) libc functions are made
available in CONFIG_POSIX context.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-04 14:46:43 +02:00
Marc Herbert 2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Paul Sokolovsky 215253910e samples: posix: gettimeofday: Make networking requirements explicit
Standard "Requirements" section copied from other networking samples,
making clear the network connection requirements and linking to
instructions for QEMU networking.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-29 23:15:12 +03:00
Paul Sokolovsky 76861d008b samples: posix: gettimeofday: Add sample.yaml
To make sure this sample is built in CI.

Also includes fixing prototype of main() to make it build without
warnings (which would be errors in CI).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-29 23:15:12 +03:00
Paul Sokolovsky 4221642b28 samples: gettimeofday: Increase stack size by 64 bytes.
Otherwise the sample started to fail on qemu_x86.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-29 23:15:12 +03:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Alberto Escolar Piedras 0b8678a2b0 samples & tests: Correct main() type
The application main() in Zephyr is defined as having a prototype:
void main(void), as expected by the kernel init (bg_thread_main).

So, correct the different samples and tests that were defined
otherwise.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-12-16 11:27:56 +01:00
Paul Sokolovsky 4e116873f5 samples: posix: gettimeofday: Demo gettimeofday() returning correct time
Achieved using CONFIG_NET_CONFIG_CLOCK_SNTP_INIT option, i.e. querying
time over network using SNTP.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-10-28 13:04:35 +02:00