forked from eclipse-iceoryx/iceoryx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iox-eclipse-iceoryx#1054 add unix platform
Signed-off-by: Christian Eltzschig <me@elchris.org>
- Loading branch information
Showing
35 changed files
with
854 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/acl.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_ACL_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_ACL_HPP | ||
|
||
#include <sys/acl.h> | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_ACL_HPP |
22 changes: 22 additions & 0 deletions
22
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/dlfcn.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_DLFCN_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_DLFCN_HPP | ||
|
||
#include <dlfcn.h> | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_DLFCN_HPP |
21 changes: 21 additions & 0 deletions
21
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/errno.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_ERRNO_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_ERRNO_HPP | ||
|
||
#include <errno.h> | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_ERRNO_HPP |
24 changes: 24 additions & 0 deletions
24
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/fcntl.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_FCNTL_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_FCNTL_HPP | ||
|
||
#include <fcntl.h> | ||
|
||
int iox_open(const char* pathname, int flags, mode_t mode); | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_FCNTL_HPP |
24 changes: 24 additions & 0 deletions
24
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/file.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_FILE_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_FILE_HPP | ||
|
||
#include <sys/file.h> | ||
|
||
int iox_flock(int fd, int op); | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_FILE_HPP |
22 changes: 22 additions & 0 deletions
22
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/getopt.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_GETOPT_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_GETOPT_HPP | ||
|
||
#include <getopt.h> | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_GETOPT_HPP |
24 changes: 24 additions & 0 deletions
24
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/grp.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_GRP_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_GRP_HPP | ||
|
||
#include <grp.h> | ||
|
||
int iox_getgrouplist(const char* user, gid_t group, gid_t* groups, int* ngroups); | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_GRP_HPP |
22 changes: 22 additions & 0 deletions
22
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/inet.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_INET_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_INET_HPP | ||
|
||
#include <arpa/inet.h> | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_INET_HPP |
25 changes: 25 additions & 0 deletions
25
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/mman.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_MMAN_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_MMAN_HPP | ||
|
||
#include <sys/mman.h> | ||
|
||
int iox_shm_open(const char* name, int oflag, mode_t mode); | ||
int iox_shm_unlink(const char* name); | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_MMAN_HPP |
25 changes: 25 additions & 0 deletions
25
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/mqueue.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_MQUEUE_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_MQUEUE_HPP | ||
|
||
#include <mqueue.h> | ||
|
||
mqd_t iox_mq_open2(const char* name, int oflag); | ||
mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr); | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_MQUEUE_HPP |
21 changes: 21 additions & 0 deletions
21
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/platform_correction.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_PLATFORM_CORRECTION_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_PLATFORM_CORRECTION_HPP | ||
|
||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_PLATFORM_CORRECTION_HPP |
43 changes: 43 additions & 0 deletions
43
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/platform_settings.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_PLATFORM_SETTINGS_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_PLATFORM_SETTINGS_HPP | ||
|
||
#include <cstdint> | ||
#include <limits.h> | ||
|
||
namespace iox | ||
{ | ||
namespace posix | ||
{ | ||
class UnixDomainSocket; | ||
} // namespace posix | ||
|
||
namespace platform | ||
{ | ||
constexpr uint64_t IOX_MAX_FILENAME_LENGTH = 255U; | ||
constexpr uint64_t IOX_MAX_PATH_LENGTH = 1023U; | ||
constexpr bool IOX_SHM_WRITE_ZEROS_ON_CREATION = true; | ||
constexpr uint64_t IOX_MAX_SHM_NAME_LENGTH = PATH_MAX; | ||
constexpr const char IOX_PATH_SEPARATORS[] = "/"; | ||
constexpr uint64_t IOX_UDS_SOCKET_MAX_MESSAGE_SIZE = 4096; | ||
constexpr const char IOX_UDS_SOCKET_PATH_PREFIX[] = "/tmp/"; | ||
constexpr const char IOX_LOCK_FILE_PATH_PREFIX[] = "/tmp/"; | ||
using IoxIpcChannelType = iox::posix::UnixDomainSocket; | ||
} // namespace platform | ||
} // namespace iox | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_PLATFORM_SETTINGS_HPP |
30 changes: 30 additions & 0 deletions
30
iceoryx_hoofs/platform/unix/include/iceoryx_hoofs/platform/pthread.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_HOOFS_LINUX_PLATFORM_PTHREAD_HPP | ||
#define IOX_HOOFS_LINUX_PLATFORM_PTHREAD_HPP | ||
|
||
#include <pthread.h> | ||
|
||
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE | ||
#define PTHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_DEFAULT | ||
|
||
inline int iox_pthread_setname_np(pthread_t thread, const char* name) | ||
{ | ||
return pthread_setname_np(thread, name); | ||
} | ||
|
||
#endif // IOX_HOOFS_LINUX_PLATFORM_PTHREAD_HPP |
Oops, something went wrong.