This page contains the information about the compatibility of OCaml-Java primitives, relatively to the original implementation.
This page only lists the primitives that are not 100% compatible.

The following icons are used:
  •  primitive is almost compatible
  •  primitive is partially compatible
  •  primitive is not implemented

Library "graph"

Module "Graphics"
 PrimitiveComment
caml_gr_set_font

Argument is interpreted as a Java font name.

Module "GraphicsX11"
 PrimitiveComment
caml_gr_close_subwindow

Does nothing.

caml_gr_open_subwindow

Does nothing, just returning a fake id.



Library "stdlib"

Module "Digest"
 PrimitiveComment
caml_md5_chan

Raises Invalid_argument if MD5 algorithm is not available.

caml_md5_string

Raises Invalid_argument if MD5 algorithm is not available.

Module "Dynlink"
 PrimitiveComment
caml_dynlink_close_lib

Does only remove the element from the list of opened libraries.

caml_dynlink_lookup_symbol

Looks for primitive in OCaml-Java primitive providers as well as primitive providers registered with the interpreter, then using loaded libraries.

caml_dynlink_open_lib

If the specified filename denotes a jar file, its entries are loaded and will be checked during primitive lookup. If it denotes a file that is not a jar one, the library is opened and it is supposed that primitives will be provided by another way (e.g. builtin primitives). If it is not a file, a try is made to consider the passed path as a fully qualified class name used as a primitive provider.

Module "Gc"
 PrimitiveComment
caml_gc_compaction

Synonym of caml_gc_full_major, except concerning counters.

caml_gc_counters
caml_gc_full_major

Hints the JVM to do a garbage collection, and runs finalizers.

caml_gc_major

Synonym of caml_gc_full_major, except concerning counters.

caml_gc_major_slice

Synonym of caml_gc_full_major, except concerning counters. Always returns 1.

caml_gc_minor

Synonym of caml_gc_full_major, except concerning counters.

caml_gc_quick_stat

Statistics are as accurate as permitted by Java access to GC statistics.

caml_gc_set

Parameters are stored (to be returned by caml_gc_set) but are ignored, as garbage collection is done by the JVM and cannot be controlled.

caml_gc_stat

Exact synonym of caml_gc_quick_stat.

Module "Obj"
 PrimitiveComment
caml_obj_set_tag

Subsequent use of block may fail if tag change implies representation shift.

caml_static_alloc

Returns a string block.

caml_static_free

Does nothing.

caml_static_release_bytecode

Does nothing.

caml_static_resize

Treats parameter as a string and returns another one.

Module "Pervasives"
 PrimitiveComment
caml_ml_flush_partial

Exact synonym of caml_ml_flush.

caml_ml_output_partial

Exact synonym of caml_ml_output.

caml_ml_set_binary_mode

Does nothing.

Module "String"
 PrimitiveComment
caml_is_printable

No locale is used.

Module "Sys"
 PrimitiveComment
caml_install_signal_handler

Signals may seem to disapper due to JVM-coexistence of multiple OCaml programs.

caml_sys_exit

According to interpreter parameters, either true (JVM shutdown) or false (stop of the interpreted program) exit. False exit is needed to allow several interpreted programs to coexist within the same JVM (as the end of one of these programs should not entail exit from JVM and hence stop other programs as well).

caml_sys_get_argv

exe_name is the empty string when the interpreter is constructed from a stream that is not a file.

caml_sys_get_config

Returns "Java", "Unix", "Cygwin", or "Win32" according to interpreter parameters. "Unix", "Cygwin", or "Win32" needed for Graphics. Size is 64. Endianness is true.

caml_sys_open

Only supports filenames handled by Java.

caml_sys_random_seed

Returns System.currentTimeMillis() / 1000.

caml_sys_time

Returns the (real) time elapsed since start, not the time used by the program.



Library "threads"

Module "Thread"
 PrimitiveComment
thread_inchan_ready

Always returns true.

thread_outchan_ready

Always returns true.

thread_wait_pid

Does nothing, returning immediately.



Library "unix"

Module "Unix"
 PrimitiveComment
unix_chown

Emulation by unix executable, if enabled and available.

unix_chroot

Emulation by unix executable, if enabled and available.

unix_clear_close_on_exec
unix_error_message

Error messages from OCaml source.

unix_execv

Emulated by program execution, then interpretation stop. Process name is thus not set.

unix_execve

Emulated by program execution, then interpretation stop. Process name is thus not set.

unix_execvp

Emulated by program execution, then interpretation stop. Process name is thus not set.

unix_execvpe

Emulated by program execution, then interpretation stop. Process name is thus not set.

unix_fchmod
unix_fchown
unix_fork
unix_fstat
unix_fstat_64
unix_getaddrinfo
unix_getegid

Always returns 1.

unix_geteuid

Always returns 1.

unix_getgid

Always returns 1.

unix_getgrgid

Always raises Not_found.

unix_getgrnam

Always raises Not_found.

unix_getgroups
unix_gethostbyaddr

Array of aliases is always empty.

unix_gethostbyname

Array of aliases is always empty.

unix_getnameinfo
unix_getpid
unix_getppid
unix_getprotobyname

Always raises Not_found.

unix_getprotobynumber

Always raises Not_found.

unix_getpwnam

Always raises Not_found.

unix_getpwuid

Always raises Not_found.

unix_getservbyname

Always raises Not_found.

unix_getservbyport

Always raises Not_found.

unix_getsockopt

Only supports SO_KEEPALIVE, SO_REUSEADDR, SO_BROADCAST, TCP_NODELAY, SO_SNDBUF, and SO_RCVBUF. Does not support SO_OOBINLINE, SO_ACCEPTCONN, SO_DONTROUTE, SO_DEBUG, IPV6_ONLY, SO_ERROR, SO_TYPE, SO_RCVLOWAT, SO_SNDLOWAT, SO_RCVTIMEO, and SO_SNDTIMEO.

unix_getuid

Always returns 1.

unix_inet_addr_of_string

Also accept textual representation (e.g. "localhost").

unix_initgroups
unix_isatty

Returns true if and only if the passed descriptor designates standard output or standard error (this hack has been set up for camlp4).

unix_kill

Emulation by unix executable, if enabled and available.

unix_lockf
unix_lstat

Exact synonym of unix_stat.

unix_lstat_64

Exact synonym of unix_stat_64.

unix_mkdir

Only supports filenames handled by Java.

unix_mkfifo

Emulation by unix executable, if enabled and available.

unix_nice

Does nothing and returns 0.

unix_open

Only supports filenames handled by Java.

unix_putenv
unix_recv

Flags are ignored.

unix_recvfrom

Flags are ignored.

unix_select

Does wait for given time if all descriptor lists are empty (as used by threads to emulate delay).

unix_send

Flags are ignored.

unix_sendto

Flags are ignored.

unix_sendto_native

Flags are ignored.

unix_set_close_on_exec
unix_setgid

Does nothing.

unix_setgroups
unix_setitimer

All three timers are based on real time.

unix_setsid
unix_setsockopt

Only supports SO_KEEPALIVE, SO_REUSEADDR, SO_BROADCAST, SO_SNDBUF, and SO_RCVBUF. Does not support SO_OOBINLINE, SO_ACCEPTCONN, SO_DONTROUTE, SO_DEBUG, SO_ERROR, SO_TYPE, SO_RCVLOWAT, and SO_SNDLOWAT.

unix_setuid

Does nothing.

unix_single_write

Exact synonym of unix_write.

unix_socket

Does not support PF_UNIX domain. Does only support SOCK_STREAM, and SOCK_DGRAM. Protocol is ignored.

unix_socketpair
unix_stat

The following restrictions apply to data accuracy: device number, inode number, number of links and device minor number are set to zero; both user and group ID are set to one; file kind is set to one if it is a directory, to four if is is a link, to zero otherwise; modification and status change time are set to modification time.

unix_stat_64

The restrictions of unix_stat apply.

unix_tcdrain
unix_tcflow
unix_tcflush
unix_tcgetattr
unix_tcsendbreak
unix_tcsetattr
unix_times

In the returned record, tms_utime field is set to the time elapsed since execution start (cf. Sys.time), other fields are set to zero (equivalent to Win32 implementation).

unix_umask
unix_wait
unix_waitpid





 
 
 
 
About this site
© 2014-2015 Xavier Clerc
webmaster AT ocamljava.org
Atom feed
Based on Bootstrap
Elements by Free Grunge Textures