summaryrefslogtreecommitdiffstats
path: root/clib/src
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-12-15 15:59:21 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-12-15 16:48:06 +1100
commit5690d7ee13ec02b28e62301bac32b5f5cfa6f761 (patch)
tree58da27b230201a699f84951af04ba6c3cc3b0e52 /clib/src
parentd38494a9cbcf12db3d923362b754299b64dc4aec (diff)
downloadffs-5690d7ee13ec02b28e62301bac32b5f5cfa6f761.tar.gz
ffs-5690d7ee13ec02b28e62301bac32b5f5cfa6f761.zip
remove unused array
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'clib/src')
-rw-r--r--clib/src/array.c496
-rw-r--r--clib/src/array_iter.c187
-rw-r--r--clib/src/timer.c140
3 files changed, 0 insertions, 823 deletions
diff --git a/clib/src/array.c b/clib/src/array.c
deleted file mode 100644
index ed4a41a..0000000
--- a/clib/src/array.c
+++ /dev/null
@@ -1,496 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: clib/src/array.c $ */
-/* */
-/* OpenPOWER FFS Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2015 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* 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. */
-/* */
-/* IBM_PROLOG_END_TAG */
-
-/*
- * File: array.c
- * Author: Shaun Wetzstein <shaun@us.ibm.com>
- * Descr: Sparse Array
- * Note:
- * Date: 08/29/10
- */
-
-#include <unistd.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <malloc.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-
-#include "assert.h"
-#include "misc.h"
-#include "hash.h"
-#include "array.h"
-#include "slab.h"
-#include "mqueue.h"
-#include "tree.h"
-#include "tree_iter.h"
-#include "bb_trace.h"
-
-/*! @cond */
-#define ARRAY_ELEM_SIZE_MIN 1
-#define ARRAY_ELEM_NUM_MIN 64
-
-#define ARRAY_MAGIC 0x48444152
-#define ARRAY_NODE_MAGIC 0x4E444152
-/*! @endcond */
-
-/* ======================================================================= */
-
-/*! @cond */
-typedef struct array_node array_node_t;
-
-struct array_node {
- uint32_t magic;
- uint32_t address;
-
- tree_node_t node;
-};
-
-const char *__array_msg[] = {
- "array: unexpected NULL pointer",
- "array: unexpected cache and/or alloc size",
- "array: out-of-memory",
- "array: uninitialized array element",
- "array: unexpected magic number",
- "array: unexpected NULL message channel",
-};
-
-#define ARRAY_NULL (__array_msg[0])
-#define ARRAY_SIZE (__array_msg[1])
-#define ARRAY_OOM (__array_msg[2])
-#define ARRAY_UNINIT_ELEM (__array_msg[3])
-#define ARRAY_MAGIC_CHECK (__array_msg[4])
-#define ARRAY_MQ_NULL (__array_msg[5])
-/*! @endcond */
-
-/* ======================================================================= */
-
-#define __index_to_page(i,s) \
-({ \
- typeof(i) _p = ((i) / (s)); \
- (i) >= 0 ? _p :_p - 1; \
-})
-
-#define __index_to_page_hashed(i,s) \
-({ \
- typeof(i) _h = int64_hash1(__index_to_page((i),(s))); \
- _h; \
-})
-
-#define __page_to_low(p,s) \
-({ \
- typeof(p) _l = (p) * (s); \
- (p) >= 0 ? _l : _l - 1; \
-})
-
-#define __page_to_high(p,s) \
-({ \
- typeof(p) _h = (p) * (s) + (s) - (typeof(p))1; \
- _h; \
-})
-
-/* ======================================================================= */
-
-static array_node_t *__array_grow(array_t * self, size_t idx)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
-
- array_node_t *node = NULL;
- switch (POSIX_MEMALIGN
- ((void **)&node, self->page_size, self->page_size)) {
- case EINVAL:
- throw_unexpected(ARRAY_SIZE);
- case ENOMEM:
- throw_unexpected(ARRAY_OOM);
- }
- assert(node != NULL);
-
- node->magic = ARRAY_NODE_MAGIC;
- node->address = (uint32_t) node;
-
- const void *key =
- (const void *)__index_to_page_hashed(idx, self->elem_num);
- tree_node_init(&node->node, key);
-
- splay_insert(&self->tree, &node->node);
- self->pages++;
-
- size_t page = __index_to_page(idx, self->elem_num);
-
- self->low = min(self->low, __page_to_low(page, self->elem_num));
- self->high = max(self->high, __page_to_high(page, self->elem_num));
-
- return node;
-}
-
-static int __array_compare(const int i1, const int i2)
-{
- return i1 - i2;
-}
-
-void array_init(array_t * self, size_t elem_size, size_t elem_num)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
-
- self->magic = ARRAY_MAGIC;
- self->high = 0;
- self->low = UINT32_MAX;
- self->size = 0;
- self->pages = 0;
-
- self->elem_size = max(elem_size, ARRAY_ELEM_SIZE_MIN);
- self->elem_num = max(elem_num, ARRAY_ELEM_NUM_MIN);
-
- self->page_size = __round_pow2(elem_size * elem_num);
-
- self->map_size = align(elem_num / CHAR_BIT, sizeof(uint32_t));
-
- self->elem_num =
- (self->page_size - sizeof(array_node_t) -
- self->map_size) / self->elem_size;
-
- tree_init(&self->tree, (compare_f) __array_compare);
-}
-
-static void __array_delete(array_t * self)
-{
- if (self != NULL) {
- while (self->tree.root != NULL) {
- array_node_t *node;
- node =
- container_of(tree_root(&self->tree), array_node_t,
- node);
- splay_remove(&self->tree, &node->node);
- FREE(node);
- }
- tree_init(&self->tree, (compare_f) __array_compare);
- }
-}
-
-void array_delete(array_t * self)
-{
- __array_delete(self);
-}
-
-static void *__array_find_page(array_t * self, size_t idx)
-{
- const void *hash =
- (const void *)__index_to_page_hashed(idx, self->elem_num);
- tree_node_t *node = tree_find(&self->tree, hash);
-
- if (node == NULL)
- return (void *)__array_grow(self, idx);
- else
- return (void *)container_of(node, array_node_t, node);
-
- return NULL;
-}
-
-static uint8_t *__array_find_map(array_t * self, size_t idx)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
-
- const void *hash =
- (const void *)__index_to_page_hashed(idx, self->elem_num);
- uint8_t *map = (uint8_t *) tree_find(&self->tree, hash);
- if (map != NULL)
- map += sizeof(tree_node_t);
-
- return map;
-}
-
-const void *array_at(array_t * self, size_t idx)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
-
- uint32_t offset = idx % self->elem_num;
-
- uint8_t *map = __array_find_page(self, idx);
- map += sizeof(array_node_t);
-
- uint8_t byte = offset / CHAR_BIT;
- uint8_t mask = 0x80 >> (offset % CHAR_BIT);
-
- if ((map[byte] & mask) == 0)
- throw_unexpected(ARRAY_UNINIT_ELEM);
-
- return map + self->map_size + (self->elem_size * offset);
-}
-
-void array_get3(array_t * self, size_t elem_off, void *ptr)
-{
- return array_get4(self, elem_off, ptr, 1);
-}
-
-void array_get4(array_t * self, size_t elem_off, void *ptr, size_t elem_num)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
-
- while (0 < elem_num) {
- memcpy(ptr, array_at(self, elem_off), self->elem_size);
-
- elem_off++;
- elem_num--;
-
- ptr += self->elem_size;
- }
-}
-
-void __array_put(array_t * self, size_t elem_off, const void *ptr)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
-
- uint32_t offset = elem_off % self->elem_num;
-
- uint8_t *map = __array_find_page(self, elem_off);
- map += sizeof(array_node_t);
-
- uint8_t byte = offset / CHAR_BIT;
- uint8_t mask = 0x80 >> (offset % CHAR_BIT);
-
- if ((map[byte] & mask) == 0)
- self->size++;
-
- map[byte] |= mask;
-
- memcpy(map + self->map_size + (self->elem_size * offset),
- ptr, self->elem_size);
-}
-
-void array_put3(array_t * self, size_t elem_off, const void *ptr)
-{
- return array_put4(self, elem_off, ptr, 1);
-}
-
-void array_put4(array_t * self, size_t elem_off, const void *ptr,
- size_t elem_num)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
-
- while (0 < elem_num) {
- __array_put(self, elem_off, ptr);
-
- elem_off++;
- elem_num--;
-
- ptr += self->elem_size;
- }
-}
-
-bool array_status2(array_t * self, size_t idx)
-{
- uint8_t *map = __array_find_map(self, idx);
-
- uint32_t offset = idx % self->elem_num;
- uint8_t byte = offset / CHAR_BIT;
- uint8_t mask = 0x80 >> (offset % CHAR_BIT);
-
- return ! !(map[byte] & mask);
-}
-
-bool array_status3(array_t * self, size_t idx, bool status)
-{
- uint8_t *map = __array_find_map(self, idx);
-
- if (map == NULL) {
- map = (uint8_t *) __array_grow(self, idx);
- map += sizeof(array_node_t);
- }
-
- uint32_t offset = idx % self->elem_num;
- uint8_t byte = offset / CHAR_BIT;
- uint8_t mask = 0x80 >> (offset % CHAR_BIT);
-
- bool ret = ! !(map[byte] & mask);
-
- map[byte] &= ~mask;
- if (status)
- map[byte] |= mask;
-
- return ret;
-}
-
-void array_resize(array_t * self, size_t size)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
- while (0 < size) {
- (void)__array_grow(self, self->high + 1);
- size /= self->elem_num;
- }
-}
-
-size_t array_size(array_t * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
- return self->size;
-}
-
-size_t array_pages(array_t * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
- return self->pages;
-}
-
-size_t array_capacity(array_t * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
- return self->high - self->low + 1;
-}
-
-size_t array_low(array_t * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
- return self->low;
-}
-
-size_t array_high(array_t * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
- return self->high;
-}
-
-void array_send(array_t * self, mqueue_t * mq)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
- if (unlikely(mq == NULL))
- throw_unexpected(ARRAY_MQ_NULL);
-
- mqueue_send(mq, (char *)self, sizeof(*self));
-
- tree_iter_t it;
- tree_iter_init(&it, &self->tree, TI_FLAG_FWD);
-
- array_node_t *node;
- tree_for_each(&it, node, node) {
- if (node->magic != ARRAY_NODE_MAGIC)
- throw_unexpected(ARRAY_MAGIC_CHECK);
-
- mqueue_send(mq, (char *)node, self->page_size);
- }
-}
-
-void array_receive(array_t * self, mqueue_t * mq)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_NULL);
- if (unlikely(mq == NULL))
- throw_unexpected(ARRAY_MQ_NULL);
-
- __array_delete(self);
-
- mqueue_attr_t attr = mqueue_getattr(mq);
-
- array_node_t *node = NULL;
- switch (POSIX_MEMALIGN
- ((void **)&node, attr.mq_msgsize, attr.mq_msgsize)) {
- case EINVAL:
- throw_unexpected(ARRAY_SIZE);
- case ENOMEM:
- throw_unexpected(ARRAY_OOM);
- }
- assert(node != NULL);
-
- ssize_t len = mqueue_receive(mq, (void *)node, attr.mq_msgsize);
- assert(0 < len);
-
- memcpy(self, (void *)node, sizeof(*self));
- tree_init(&self->tree, (compare_f) __array_compare);
-
- for (int i = 0; i < array_pages(self); i++) {
- if (node == NULL) {
- switch (POSIX_MEMALIGN
- ((void **)&node, attr.mq_msgsize,
- attr.mq_msgsize)) {
- case EINVAL:
- throw_unexpected(ARRAY_SIZE);
- case ENOMEM:
- throw_unexpected(ARRAY_OOM);
- }
- }
-
- len = mqueue_receive(mq, (void *)node, attr.mq_msgsize);
- assert(0 < len);
-
- node->address = (uint32_t) node;
- tree_node_init(&node->node, node->node.key);
- splay_insert(&self->tree, &node->node);
-
- node = NULL;
- }
-}
-
-void array_dump(array_t * self, FILE * out)
-{
- if (self != NULL) {
- fprintf(out,
- "array: [ page_size: %5u pages: %5u map_size: %5u capacity: %10u ]\n",
- self->page_size, self->pages, self->map_size,
- array_capacity(self));
- fprintf(out,
- " [ elem_size: %5u elem_num: %5u size: %10u range: (%u....%u) ]\n",
- self->elem_size, self->elem_num, array_size(self),
- array_low(self), array_high(self));
-
- dump_memory(out, (unsigned long)self, self, sizeof(*self));
-
- tree_iter_t it;
- for (tree_iter_init(&it, &self->tree, TI_FLAG_FWD);
- tree_iter_elem(&it); tree_iter_inc(&it)) {
- array_node_t *node;
- node =
- container_of(tree_iter_elem(&it), array_node_t,
- node);
-
- fprintf(out, "magic[%x] address[%x]\n",
- node->magic, node->address);
- fprintf(out,
- "n[%p] left[%p] right[%p] parent[%p] key[%p] \n",
- &node->node, node->node.left, node->node.right,
- node->node.parent, node->node.key);
-
- dump_memory(out, (unsigned long)node, node,
- self->page_size);
- }
- }
-}
-
-/* ======================================================================= */
diff --git a/clib/src/array_iter.c b/clib/src/array_iter.c
deleted file mode 100644
index f7569c9..0000000
--- a/clib/src/array_iter.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: clib/src/array_iter.c $ */
-/* */
-/* OpenPOWER FFS Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2015 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* 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. */
-/* */
-/* IBM_PROLOG_END_TAG */
-
-/*
- * File: array_iter.c
- * Author: Shaun Wetzstein <shaun@us.ibm.com>
- * Descr: dynamic array
- * Note:
- * Date: 10/22/10
- */
-
-#include <unistd.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <malloc.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-
-#include "assert.h"
-#include "misc.h"
-#include "hash.h"
-#include "nargs.h"
-#include "array_iter.h"
-
-/* ======================================================================= */
-
-const char *__array_iter_msg[] = {
- "array_iter: unexpected NULL pointer",
- "array_iter: index out-of-range",
-};
-
-#define ARRAY_ITER_NULL (__array_iter_msg[0])
-#define ARRAY_ITER_RANGE (__array_iter_msg[1])
-
-/* ======================================================================= */
-
-static inline const void *__array_iter_bwd(array_iter_t * self)
-{
- size_t low = array_low(self->array);
- const void *ret = NULL;
-
- if (low < self->idx)
- self->idx--;
-
- while (low < self->idx) {
- if (array_status(self->array, self->idx))
- break;
- self->idx--;
- }
-
- if (low < self->idx)
- ret = array_at(self->array, self->idx);
-
- return ret;
-}
-
-static inline const void *__array_iter_fwd(array_iter_t * self)
-{
- size_t high = array_high(self->array);
- const void *ret = NULL;
-
- if (self->idx < high)
- self->idx++;
-
- while (self->idx < high) {
- if (array_status(self->array, self->idx))
- break;
- self->idx++;
- }
-
- if (self->idx < high)
- ret = array_at(self->array, self->idx);
-
- return ret;
-}
-
-void array_iter_init(array_iter_t * self, array_t * array, uint32_t flags)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_ITER_NULL);
- if (unlikely(array == NULL))
- throw_unexpected(ARRAY_ITER_NULL);
-
- self->flags = flags;
- self->array = array;
-
- if (self->flags & AI_FLAG_BWD) {
- self->idx = array_high(self->array);
- __array_iter_bwd(self);
- } else {
- self->idx = array_low(self->array);
- __array_iter_fwd(self);
- }
-}
-
-void array_iter_clear(array_iter_t * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_ITER_NULL);
-
- if (self->flags & AI_FLAG_BWD)
- self->idx = array_high(self->array);
- else
- self->idx = array_low(self->array);
-
- self->array = NULL;
-}
-
-const void *array_iter_elem(array_iter_t * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_ITER_NULL);
- if (self->idx < array_low(self->array))
- throw_unexpected(ARRAY_ITER_RANGE);
- if (array_high(self->array) <= self->idx)
- throw_unexpected(ARRAY_ITER_RANGE);
-
- return array_status(self->array, self->idx) ?
- array_at(self->array, self->idx) : NULL;
-}
-
-const void *array_iter_inc1(array_iter_t * self)
-{
- return array_iter_inc2(self, 1);
-}
-
-const void *array_iter_inc2(array_iter_t * self, size_t inc)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_ITER_NULL);
-
- const void *ret = NULL;
-
- if (self->flags & AI_FLAG_BWD)
- ret = __array_iter_bwd(self);
- else
- ret = __array_iter_fwd(self);
-
- return ret;
-}
-
-const void *array_iter_dec1(array_iter_t * self)
-{
- return array_iter_dec2(self, 1);
-}
-
-const void *array_iter_dec2(array_iter_t * self, size_t dec)
-{
- if (unlikely(self == NULL))
- throw_unexpected(ARRAY_ITER_NULL);
-
- const void *ret = NULL;
-
- if (self->flags & AI_FLAG_BWD)
- ret = __array_iter_fwd(self);
- else
- ret = __array_iter_bwd(self);
-
- return ret;
-}
-
-/* ======================================================================= */
diff --git a/clib/src/timer.c b/clib/src/timer.c
deleted file mode 100644
index ffe9e8f..0000000
--- a/clib/src/timer.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: clib/src/timer.c $ */
-/* */
-/* OpenPOWER FFS Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2015 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* 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. */
-/* */
-/* IBM_PROLOG_END_TAG */
-
-/*
- * File: timer.c
- * Author: Shaun Wetzstein <shaun@us.ibm.com>
- * Descr:
- * Note:
- * Date: 10/03/10
- */
-
-#include <unistd.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <malloc.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-
-#include "misc.h"
-#include "timer.h"
-
-#define TIMER_PAGE_SIZE 64
-#define TIMER_EVENT_SIZE 64
-
-/* ======================================================================= */
-
-const char *__timer_msg[] = {
- "timer: unexpected NULL self pointer",
- "timer: unexpected NULL callback structure",
-};
-
-#define TIMER_NULL (__timer_msg[0])
-#define TIMER_CALLBACK_NULL (__timer_msg[1])
-
-/* ======================================================================= */
-
-void timer_init(timer * self, int clock)
-{
- if (unlikely(self == NULL))
- throw_unexpected(TIMER_NULL);
-
- if (self->fd != -1)
- close(self->fd), self->fd = -1;
-
- self->fd = timerfd_create(clock, TFD_CLOEXEC);
- if (unlikely(self->fd == -1))
- throw_errno(errno);
-
- vector_init(&self->callbacks, "callbacks",
- sizeof(timer_callback), TIMER_PAGE_SIZE);
-}
-
-void timer_delete(timer * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(TIMER_NULL);
- close(self->fd), self->fd = -1;
-}
-
-int timer_fileno(timer * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(TIMER_NULL);
- return self->fd;
-}
-
-uint32_t timer_add(timer * self, timer_callback * cb)
-{
- if (unlikely(self == NULL))
- throw_unexpected(TIMER_NULL);
-
- if (access(path, F_OK) != 0)
- throw_errno(errno);
-
- uint32_t wd = inotify_add_timer(self->fd, path, events);
- if (unlikely((int)wd == -1))
- throw_errno(errno);
-
- if (cb != NULL)
- vcetor_put(&self->callbacks, wd, cb);
-
- return wd;
-}
-
-void timer_remove(timer * self, uint32_t wd)
-{
- if (unlikely(self == NULL))
- throw_unexpected(TIMER_NULL);
-
- int rc = inotify_rm_timer(self->fd, wd);
- if (unlikely(rc == -1))
- throw_errno(errno);
-
- array_status(&self->callbacks, wd, false);
-}
-
-void timer_wait(timer * self)
-{
- if (unlikely(self == NULL))
- throw_unexpected(TIMER_NULL);
-
- /* FIX ME */
-
- timer_event events[timer_EVENT_SIZE];
-
- int n = read(self->fd, events, sizeof events);
- printf("n[%d]\n", n);
-
- for (int i = 0; i < (n / sizeof *events); i++)
- printf("%d: wd[%d] mask[%x] cookie[%x] name[%.*s]\n",
- i, events[i].wd, events[i].mask, events[i].cookie,
- events[i].len, events[i].name);
-}
-
-/* ======================================================================= */
OpenPOWER on IntegriCloud