Home / File/ netty_unix_util.h — netty Source File

netty_unix_util.h — netty Source File

Architecture documentation for netty_unix_util.h, a c file in the netty codebase. 4 imports, 7 dependents.

File c NativeTransport 4 imports 7 dependents

Entity Profile

Dependency Diagram

graph LR
  e811edce_3305_6244_830c_daac1b109259["netty_unix_util.h"]
  89cfd132_669d_bc14_f916_80a38e3da8a5["netty_jni_util.h"]
  e811edce_3305_6244_830c_daac1b109259 --> 89cfd132_669d_bc14_f916_80a38e3da8a5
  0c4a58dc_2fdd_e4ad_9234_08a5790f43e3["jni.h"]
  e811edce_3305_6244_830c_daac1b109259 --> 0c4a58dc_2fdd_e4ad_9234_08a5790f43e3
  617ed4cf_d595_a5c7_1593_810f21ce0712["stdint.h"]
  e811edce_3305_6244_830c_daac1b109259 --> 617ed4cf_d595_a5c7_1593_810f21ce0712
  53493a33_7785_13b5_d1b9_17976c8edd90["time.h"]
  e811edce_3305_6244_830c_daac1b109259 --> 53493a33_7785_13b5_d1b9_17976c8edd90
  b460dd0c_7b1f_bf55_7d35_099b60c3ebbf["netty_unix.c"]
  b460dd0c_7b1f_bf55_7d35_099b60c3ebbf --> e811edce_3305_6244_830c_daac1b109259
  e658b854_3b29_546c_94d2_176ab5009705["netty_unix_buffer.c"]
  e658b854_3b29_546c_94d2_176ab5009705 --> e811edce_3305_6244_830c_daac1b109259
  b538e79f_f5cb_cc60_5a77_6b2382df83f1["netty_unix_errors.c"]
  b538e79f_f5cb_cc60_5a77_6b2382df83f1 --> e811edce_3305_6244_830c_daac1b109259
  f6d32bf1_70b8_bf34_2f66_0f64bd206740["netty_unix_filedescriptor.c"]
  f6d32bf1_70b8_bf34_2f66_0f64bd206740 --> e811edce_3305_6244_830c_daac1b109259
  e2be95ac_aaa8_ced5_66a9_a1e6249bee79["netty_unix_limits.c"]
  e2be95ac_aaa8_ced5_66a9_a1e6249bee79 --> e811edce_3305_6244_830c_daac1b109259
  daa4babc_e657_7631_ad9c_10c8bb120f11["netty_unix_socket.c"]
  daa4babc_e657_7631_ad9c_10c8bb120f11 --> e811edce_3305_6244_830c_daac1b109259
  19a074e9_8b10_2a90_2638_84c2ea6cb91f["netty_unix_util.c"]
  19a074e9_8b10_2a90_2638_84c2ea6cb91f --> e811edce_3305_6244_830c_daac1b109259
  style e811edce_3305_6244_830c_daac1b109259 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/*
 * Copyright 2016 The Netty Project
 *
 * The Netty Project licenses this file to you 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:
 *
 *   https://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.
 */

#ifndef NETTY_UNIX_UTIL_H_
#define NETTY_UNIX_UTIL_H_

#include <jni.h>
#include <stdint.h>
#include <time.h>
#include "netty_jni_util.h"


#if defined(__MACH__) && !defined(CLOCK_REALTIME)
#define NETTY_USE_MACH_INSTEAD_OF_CLOCK

typedef int clockid_t;

#ifndef CLOCK_MONOTONIC
#define CLOCK_MONOTONIC 1
#endif

#ifndef CLOCK_MONOTONIC_COARSE
#define CLOCK_MONOTONIC_COARSE 2
#endif

#endif /* __MACH__ */

/**
 * Get a clock which can be used to measure execution time.
 *
 * Returns true is a suitable clock was found.
 */
jboolean netty_unix_util_initialize_wait_clock(clockid_t* clockId);

/**
 * This will delegate to clock_gettime from time.h if the platform supports it.
 *
 * MacOS does not support clock_gettime.
 */
int netty_unix_util_clock_gettime(clockid_t clockId, struct timespec* tp);

/**
 * Calculate the number of nano seconds elapsed between begin and end.
 *
 * Returns the number of nano seconds.
 */
uint64_t netty_unix_util_timespec_elapsed_ns(const struct timespec* begin, const struct timespec* end);

/**
 * Subtract <pre>nanos</pre> nano seconds from a <pre>timespec</pre>.
 *
 * Returns true if there is underflow.
 */
jboolean netty_unix_util_timespec_subtract_ns(struct timespec* ts, uint64_t nanos);

#endif /* NETTY_UNIX_UTIL_H_ */

Dependencies

  • jni.h
  • netty_jni_util.h
  • stdint.h
  • time.h

Frequently Asked Questions

What does netty_unix_util.h do?
netty_unix_util.h is a source file in the netty codebase, written in c. It belongs to the NativeTransport domain.
What does netty_unix_util.h depend on?
netty_unix_util.h imports 4 module(s): jni.h, netty_jni_util.h, stdint.h, time.h.
What files import netty_unix_util.h?
netty_unix_util.h is imported by 7 file(s): netty_unix.c, netty_unix_buffer.c, netty_unix_errors.c, netty_unix_filedescriptor.c, netty_unix_limits.c, netty_unix_socket.c, netty_unix_util.c.
Where is netty_unix_util.h in the architecture?
netty_unix_util.h is located at transport-native-unix-common/src/main/c/netty_unix_util.h (domain: NativeTransport, directory: transport-native-unix-common/src/main/c).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free